private static byte[][] splitInUniformRegions(Configuration hBaseConf, int numRegions) throws IOException { KeyGenerator keyGen = KeyGeneratorImplementations.defaultKeyGenerator(); RegionSplitter.SplitAlgorithm algo = RegionSplitter.newSplitAlgoInstance(hBaseConf, RegionSplitter.UniformSplit.class.getName()); algo.setFirstRow(algo.rowToStr(keyGen.startTimestampToKey(0))); algo.setLastRow(algo.rowToStr(keyGen.startTimestampToKey(Long.MAX_VALUE))); // Return the split keys return algo.split(numRegions); }
private static byte[][] splitInUniformRegions(Configuration hBaseConf, int numRegions) throws IOException { KeyGenerator keyGen = KeyGeneratorImplementations.defaultKeyGenerator(); RegionSplitter.SplitAlgorithm algo = RegionSplitter.newSplitAlgoInstance(hBaseConf, RegionSplitter.UniformSplit.class.getName()); algo.setFirstRow(algo.rowToStr(keyGen.startTimestampToKey(0))); algo.setLastRow(algo.rowToStr(keyGen.startTimestampToKey(Long.MAX_VALUE))); // Return the split keys return algo.split(numRegions); }