Skip to content

Commit

Permalink
Merge pull request #117 from gelin/fieldnameprefix
Browse files Browse the repository at this point in the history
 Conflicts:
	core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java
	doc/coreproperties.html
	hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java
  • Loading branch information
busbey committed Sep 5, 2018
2 parents b31a568 + fddf3e6 commit c99a7e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 14 additions & 1 deletion core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java
Expand Up @@ -61,6 +61,8 @@
* digits in the record number.
* <LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed
* order ("hashed") (default: hashed)
* <LI><b>fieldnameprefix</b>: what should be a prefix for field names, the shorter may decrease the
* required storage size (default: "field")
* </ul>
*/
public class CoreWorkload extends Workload {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion doc/coreproperties.html
Expand Up @@ -39,7 +39,8 @@ <H2>Core workload package properties</h2>
<LI><b>requestdistribution</b>: what distribution should be used to select the records to operate on - uniform, zipfian or latest (default: uniform)
<LI><b>maxscanlength</b>: for scans, what is the maximum number of records to scan (default: 1000)
<LI><b>scanlengthdistribution</b>: for scans, what distribution should be used to choose the number of records to scan, for each scan, between 1 and maxscanlength (default: uniform)
<LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed)
<LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed)
<LI><b>fieldnameprefix</b>: string prefix for the field name (default: “field”)
</UL>
<HR>
YCSB - Yahoo! Research - Contact cooperb@yahoo-inc.com.
Expand Down

0 comments on commit c99a7e4

Please sign in to comment.