operationchooser.addValue(Config.getConfig().read_write_modify_proportion, "READMODIFYWRITE");
}
transactioninsertkeysequence = new CounterGenerator(recordcount);
if (Config.getConfig().request_distribution.compareTo("uniform") == 0) {
keychooser = new UniformIntegerGenerator(0, recordcount - 1);
} else if (Config.getConfig().request_distribution.compareTo("zipfian") == 0) {
// it does this by generating a random "next key" in part by taking
// the modulus over the number of keys
// if the number of keys changes, this would shift the modulus, and
// we don't want that to change which keys are popular
// so we'll actually construct the scrambled zipfian generator with
// a keyspace that is larger than exists at the beginning
// of the test. that is, we'll predict the number of inserts, and
// tell the scrambled zipfian generator the number of existing keys
// plus the number of predicted keys as the total keyspace. then, if
// the generator picks a key that hasn't been inserted yet, will
// just ignore it and pick another key. this way, the size of the
// keyspace doesn't change from the perspective of the scrambled
// zipfian generator
int opcount = Config.getConfig().operation_count;
int expectednewkeys = (int) (((double) opcount) * Config.getConfig().insert_proportion * 2.0); // 2
// is
// fudge
// factor
keychooser = new ScrambledZipfianGenerator(recordcount
+ expectednewkeys);
} else if (Config.getConfig().request_distribution.compareTo("latest") == 0) {
keychooser = new SkewedLatestGenerator(transactioninsertkeysequence);
} else if (Config.getConfig().request_distribution.compareTo("churn") == 0){
keychooser = new ChurnGenerator(Config.getConfig().working_set, Config.getConfig().churn_delta, recordcount);
} else {
throw new WorkloadException("Unknown distribution \"" + Config.getConfig().request_distribution + "\"");
}
fieldchooser = new UniformIntegerGenerator(0, Config.getConfig().field_count - 1);
if (Config.getConfig().scan_length_distribution.compareTo("uniform") == 0) {
scanlength = new UniformIntegerGenerator(1, Config.getConfig().max_scan_length);
} else if (Config.getConfig().scan_length_distribution.compareTo("zipfian") == 0) {
scanlength = new ZipfianGenerator(1, Config.getConfig().max_scan_length);
} else {
throw new WorkloadException("Distribution \"" + Config.getConfig().scan_length_distribution
+ "\" not allowed for scan length");