Пример #1
0
 /**
  * Creates a pre-split table with expectedBounds.size()+1 regions, then verifies that the region
  * boundaries are the same as the expected region boundaries in expectedBounds.
  *
  * @throws Various junit assertions
  */
 private void preSplitTableAndVerify(
     List<byte[]> expectedBounds, String splitClass, String tableName) throws Exception {
   final int numRegions = expectedBounds.size() - 1;
   final Configuration conf = UTIL.getConfiguration();
   conf.setInt("split.count", numRegions);
   SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
   RegionSplitter.createPresplitTable(tableName, splitAlgo, new String[] {CF_NAME}, conf);
   verifyBounds(expectedBounds, tableName);
 }
Пример #2
0
  private void rollingSplitAndVerify(
      String tableName, String splitClass, List<byte[]> expectedBounds) throws Exception {
    final Configuration conf = UTIL.getConfiguration();

    // Set this larger than the number of splits so RegionSplitter won't block
    conf.setInt("split.outstanding", 5);
    SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
    RegionSplitter.rollingSplit(tableName, splitAlgo, conf);
    verifyBounds(expectedBounds, tableName);
  }