Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workload/ycsb: add flag to use column families #32704

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion pkg/workload/ycsb/ycsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,30 @@ const (
FIELD8 TEXT,
FIELD9 TEXT
)`
usertableSchemaRelationalWithFamilies = `(
ycsb_key VARCHAR(255) PRIMARY KEY NOT NULL,
FIELD0 TEXT,
FIELD1 TEXT,
FIELD2 TEXT,
FIELD3 TEXT,
FIELD4 TEXT,
FIELD5 TEXT,
FIELD6 TEXT,
FIELD7 TEXT,
FIELD8 TEXT,
FIELD9 TEXT,
FAMILY (ycsb_key),
FAMILY (FIELD0),
FAMILY (FIELD1),
FAMILY (FIELD2),
FAMILY (FIELD3),
FAMILY (FIELD4),
FAMILY (FIELD5),
FAMILY (FIELD6),
FAMILY (FIELD7),
FAMILY (FIELD8),
FAMILY (FIELD9)
)`
usertableSchemaJSON = `(
ycsb_key VARCHAR(255) PRIMARY KEY NOT NULL,
FIELD JSONB
Expand All @@ -64,6 +88,7 @@ type ycsb struct {
seed int64
initialRows int
json bool
families bool
splits int

workload string
Expand All @@ -89,6 +114,7 @@ var ycsbMeta = workload.Meta{
g.flags.IntVar(&g.initialRows, `initial-rows`, 10000,
`Initial number of rows to sequentially insert before beginning Zipfian workload`)
g.flags.BoolVar(&g.json, `json`, false, `Use JSONB rather than relational data`)
g.flags.BoolVar(&g.families, `families`, true, `Place each column in its own column family`)
g.flags.IntVar(&g.splits, `splits`, 0, `Number of splits to perform before starting normal operations`)
g.flags.StringVar(&g.workload, `workload`, `B`, `Workload type. Choose from A-F.`)
g.flags.StringVar(&g.distribution, `request-distribution`, `zipfian`, `Distribution for random number generator [zipfian, uniform].`)
Expand Down Expand Up @@ -169,7 +195,11 @@ func (g *ycsb) Tables() []workload.Table {
if g.json {
usertable.Schema = usertableSchemaJSON
} else {
usertable.Schema = usertableSchemaRelational
if g.families {
usertable.Schema = usertableSchemaRelationalWithFamilies
} else {
usertable.Schema = usertableSchemaRelational
}
}
return []workload.Table{usertable}
}
Expand Down