diff --git a/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java b/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java index d3fd84b30e..845d86eab0 100644 --- a/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java +++ b/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java @@ -61,6 +61,8 @@ * digits in the record number. *
  • insertorder: should records be inserted in order by key ("ordered"), or in hashed * order ("hashed") (default: hashed) + *
  • fieldnameprefix: what should be a prefix for field names, the shorter may decrease the + * required storage size (default: "field") * */ public class CoreWorkload extends Workload { @@ -329,6 +331,16 @@ public class CoreWorkload extends Workload { public static final String INSERTION_RETRY_INTERVAL = "core_workload_insertion_retry_interval"; public static final String INSERTION_RETRY_INTERVAL_DEFAULT = "3"; + /** + * Field name prefix. + */ + public static final String FIELD_NAME_PREFIX = "fieldnameprefix"; + + /** + * Default value of the field name prefix. + */ + public static final String FIELD_NAME_PREFIX_DEFAULT = "field"; + protected NumberGenerator keysequence; protected DiscreteGenerator operationchooser; protected NumberGenerator keychooser; @@ -384,9 +396,10 @@ public void init(Properties p) throws WorkloadException { fieldcount = Long.parseLong(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT)); + final String fieldnameprefix = p.getProperty(FIELD_NAME_PREFIX, FIELD_NAME_PREFIX_DEFAULT); fieldnames = new ArrayList<>(); for (int i = 0; i < fieldcount; i++) { - fieldnames.add("field" + i); + fieldnames.add(fieldnameprefix + i); } fieldlengthgenerator = CoreWorkload.getFieldLengthGenerator(p); diff --git a/doc/coreproperties.html b/doc/coreproperties.html index a03e967357..40a9d6a5da 100644 --- a/doc/coreproperties.html +++ b/doc/coreproperties.html @@ -39,7 +39,8 @@

    Core workload package properties

  • requestdistribution: what distribution should be used to select the records to operate on - uniform, zipfian or latest (default: uniform)
  • maxscanlength: for scans, what is the maximum number of records to scan (default: 1000)
  • scanlengthdistribution: for scans, what distribution should be used to choose the number of records to scan, for each scan, between 1 and maxscanlength (default: uniform) -
  • insertorder: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed) +
  • insertorder: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed) +
  • fieldnameprefix: string prefix for the field name (default: “field”)
    YCSB - Yahoo! Research - Contact cooperb@yahoo-inc.com.