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

项目:ditb    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);
  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "tableName=" + this.tableName +
        ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", useTags=" + this.useTags +
        ", noOfTags=" + this.noOfTags;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:LCIndex-HBase-0.94.16    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", sampleRate=" + this.sampleRate +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", reportLatency=" + this.reportLatency;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:LCIndex-HBase-0.94.16    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:HIndex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c, final TestOptions opts) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);

  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (opts.totalRows / opts.numClientThreads);
  ObjectMapper mapper = new ObjectMapper();
  mapper.configure(SORT_PROPERTIES_ALPHABETICALLY, true);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < opts.numClientThreads; j++) {
        TestOptions next = new TestOptions(opts);
        next.startRow = (j * perClientRows) + (i * (perClientRows/10));
        next.perClientRunRows = perClientRows / 10;
        String s = mapper.writeValueAsString(next);
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:HIndex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);
  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "tableName=" + this.tableName +
        ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", useTags=" + this.useTags +
        ", noOfTags=" + this.noOfTags;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:IRIndex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", sampleRate=" + this.sampleRate +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", reportLatency=" + this.reportLatency;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:IRIndex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hbase    文件:PerformanceEvaluation.java   
static Path writeInputFile(final Configuration c, final TestOptions opts, final Path basedir)
throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(new Path(basedir, PERF_EVAL_DIR), formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);

  Path inputFile = new Path(inputDir, JOB_INPUT_FILENAME);
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (opts.totalRows / opts.numClientThreads);
  try {
    for (int j = 0; j < opts.numClientThreads; j++) {
      TestOptions next = new TestOptions(opts);
      next.startRow = j * perClientRows;
      next.perClientRunRows = perClientRows;
      String s = MAPPER.writeValueAsString(next);
      LOG.info("Client=" + j + ", input=" + s);
      byte[] b = Bytes.toBytes(s);
      int hash = h.hash(new ByteArrayHashKey(b, 0, b.length), -1);
      m.put(hash, s);
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:hbase    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);
  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "tableName=" + this.tableName +
        ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", useTags=" + this.useTags +
        ", noOfTags=" + this.noOfTags;
        byte[] b = Bytes.toBytes(s);
        int hash = h.hash(new ByteArrayHashKey(b, 0, b.length), -1);
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:PyroDB    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c, final TestOptions opts) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);

  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (opts.totalRows / opts.numClientThreads);
  ObjectMapper mapper = new ObjectMapper();
  mapper.configure(SORT_PROPERTIES_ALPHABETICALLY, true);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < opts.numClientThreads; j++) {
        TestOptions next = new TestOptions(opts);
        next.startRow = (j * perClientRows) + (i * (perClientRows/10));
        next.perClientRunRows = perClientRows / 10;
        String s = mapper.writeValueAsString(next);
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:PyroDB    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);
  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "tableName=" + this.tableName +
        ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", useTags=" + this.useTags +
        ", noOfTags=" + this.noOfTags;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:c5    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);

  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "tableName=" + this.tableName +
        ", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", sampleRate=" + this.sampleRate +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL +
        ", reportLatency=" + this.reportLatency;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:c5    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:HBase-Research    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:HBase-Research    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hbase-0.94.8-qod    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hbase-0.94.8-qod    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hbase-0.94.8-qod    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hbase-0.94.8-qod    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:DominoHBase    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  Path inputDir = new Path(jobdir, "inputs");

  FileSystem fs = FileSystem.get(c);
  fs.mkdirs(inputDir);

  Path inputFile = new Path(inputDir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return inputDir;
}
项目:DominoHBase    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hindex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (this.R / this.N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + this.R +
        ", clients=" + this.N +
        ", flushCommits=" + this.flushCommits +
        ", writeToWAL=" + this.writeToWAL;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}
项目:hindex    文件:PerformanceEvaluation.java   
private Path writeInputFile(final Configuration c) throws IOException {
  FileSystem fs = FileSystem.get(c);
  if (!fs.exists(PERF_EVAL_DIR)) {
    fs.mkdirs(PERF_EVAL_DIR);
  }
  SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
  fs.mkdirs(subdir);
  Path inputFile = new Path(subdir, "input.txt");
  PrintStream out = new PrintStream(fs.create(inputFile));
  // Make input random.
  Map<Integer, String> m = new TreeMap<Integer, String>();
  Hash h = MurmurHash.getInstance();
  int perClientRows = (R / N);
  try {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < N; j++) {
        String s = "startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
        ", perClientRunRows=" + (perClientRows / 10) +
        ", totalRows=" + R +
        ", clients=" + N +
        ", rowsPerPut=" + B;
        int hash = h.hash(Bytes.toBytes(s));
        m.put(hash, s);
      }
    }
    for (Map.Entry<Integer, String> e: m.entrySet()) {
      out.println(e.getValue());
    }
  } finally {
    out.close();
  }
  return subdir;
}