Java 类org.apache.hadoop.hbase.util.MultiThreadedAction 实例源码

项目:ditb    文件:StripeCompactionsPerformanceEvaluation.java   
@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);
}
项目:HIndex    文件:StripeCompactionsPerformanceEvaluation.java   
@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);
}
项目:hbase    文件:StripeCompactionsPerformanceEvaluation.java   
@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);
}
项目:PyroDB    文件:StripeCompactionsPerformanceEvaluation.java   
@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);
}