@Override protected void processOptions(CommandLine cmd) { int minValueSize = 0, maxValueSize = 0; String valueSize = cmd.getOptionValue(VALUE_SIZE_KEY, VALUE_SIZE_DEFAULT); if (valueSize.contains(":")) { String[] valueSizes = valueSize.split(":"); if (valueSize.length() != 2) throw new RuntimeException("Invalid value size: " + valueSize); minValueSize = Integer.parseInt(valueSizes[0]); maxValueSize = Integer.parseInt(valueSizes[1]); } else { minValueSize = maxValueSize = Integer.parseInt(valueSize); } String datagen = cmd.getOptionValue(DATAGEN_KEY, "default").toLowerCase(); if ("default".equals(datagen)) { dataGen = new MultiThreadedAction.DefaultDataGenerator( minValueSize, maxValueSize, 1, 1, new byte[][] { COLUMN_FAMILY }); } else if ("sequential".equals(datagen)) { int shards = Integer.parseInt(cmd.getOptionValue(SEQ_SHARDS_PER_SERVER_KEY, "1")); dataGen = new SeqShardedDataGenerator(minValueSize, maxValueSize, shards); } else { throw new RuntimeException("Unknown " + DATAGEN_KEY + ": " + datagen); } iterationCount = Integer.parseInt(cmd.getOptionValue(ITERATIONS_KEY, "1")); preloadKeys = Long.parseLong(cmd.getOptionValue(PRELOAD_COUNT_KEY, "1000000")); writeKeys = Long.parseLong(cmd.getOptionValue(WRITE_COUNT_KEY, "1000000")); writeThreads = Integer.parseInt(cmd.getOptionValue(WRITE_THREADS_KEY, "10")); readThreads = Integer.parseInt(cmd.getOptionValue(READ_THREADS_KEY, "20")); initialStripeCount = getLongOrNull(cmd, INITIAL_STRIPE_COUNT_KEY); splitSize = getLongOrNull(cmd, SPLIT_SIZE_KEY); splitParts = getLongOrNull(cmd, SPLIT_PARTS_KEY); }
@Override protected void processOptions(CommandLine cmd) { int minValueSize = 0, maxValueSize = 0; String valueSize = cmd.getOptionValue(VALUE_SIZE_KEY, VALUE_SIZE_DEFAULT); if (valueSize.contains(":")) { String[] valueSizes = valueSize.split(":"); if (valueSize.length() != 2) throw new RuntimeException("Invalid value size: " + valueSize); minValueSize = Integer.parseInt(valueSizes[0]); maxValueSize = Integer.parseInt(valueSizes[1]); } else { minValueSize = maxValueSize = Integer.parseInt(valueSize); } String datagen = cmd.getOptionValue(DATAGEN_KEY, "default").toLowerCase(Locale.ROOT); if ("default".equals(datagen)) { dataGen = new MultiThreadedAction.DefaultDataGenerator( minValueSize, maxValueSize, 1, 1, new byte[][] { COLUMN_FAMILY }); } else if ("sequential".equals(datagen)) { int shards = Integer.parseInt(cmd.getOptionValue(SEQ_SHARDS_PER_SERVER_KEY, "1")); dataGen = new SeqShardedDataGenerator(minValueSize, maxValueSize, shards); } else { throw new RuntimeException("Unknown " + DATAGEN_KEY + ": " + datagen); } iterationCount = Integer.parseInt(cmd.getOptionValue(ITERATIONS_KEY, "1")); preloadKeys = Long.parseLong(cmd.getOptionValue(PRELOAD_COUNT_KEY, "1000000")); writeKeys = Long.parseLong(cmd.getOptionValue(WRITE_COUNT_KEY, "1000000")); writeThreads = Integer.parseInt(cmd.getOptionValue(WRITE_THREADS_KEY, "10")); readThreads = Integer.parseInt(cmd.getOptionValue(READ_THREADS_KEY, "20")); initialStripeCount = getLongOrNull(cmd, INITIAL_STRIPE_COUNT_KEY); splitSize = getLongOrNull(cmd, SPLIT_SIZE_KEY); splitParts = getLongOrNull(cmd, SPLIT_PARTS_KEY); }