Java Code Examples for org.apache.hadoop.hbase.util.RegionSplitter#UniformSplit

The following examples show how to use org.apache.hadoop.hbase.util.RegionSplitter#UniformSplit . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMobCompactionWithDefaults.java    From hbase with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
  tableDescriptor = HTU.createModifyableTableDescriptor(test.getMethodName());
  admin = HTU.getAdmin();
  cleanerChore = new MobFileCleanerChore();
  familyDescriptor = new ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor(fam);
  familyDescriptor.setMobEnabled(true);
  familyDescriptor.setMobThreshold(mobLen);
  familyDescriptor.setMaxVersions(1);
  tableDescriptor.setColumnFamily(familyDescriptor);
  RegionSplitter.UniformSplit splitAlgo = new RegionSplitter.UniformSplit();
  byte[][] splitKeys = splitAlgo.split(numRegions);
  table = HTU.createTable(tableDescriptor, splitKeys).getName();
}
 
Example 2
Source File: BulkImportRunner.java    From zerowing with MIT License 5 votes vote down vote up
private byte[][] calculateRegionSplits(MongoURI uri, String tableName) throws Exception {
  DBCollection collection = uri.connectDB().getCollection(uri.getCollection());
  long size = collection.getStats().getLong("size");
  long regionSize = ConfigUtil.getPresplitTableRegionSize(_conf);
  int numRegions = (int) Math.min((size / regionSize) + 1, 4096);

  if (numRegions > 1) {
    log.info("Pre-splitting " + tableName + " into " + numRegions + " regions");
    RegionSplitter.UniformSplit splitter = new RegionSplitter.UniformSplit();
    return splitter.split(numRegions);
  } else {
    log.info("Not splitting " + tableName + ", because the data can fit into a single region");
    return new byte[0][0];
  }
}
 
Example 3
Source File: Split.java    From hbase-tools with Apache License 2.0 4 votes vote down vote up
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
    return new RegionSplitter.UniformSplit();
}
 
Example 4
Source File: Split.java    From hbase-tools with Apache License 2.0 4 votes vote down vote up
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
    return new RegionSplitter.UniformSplit();
}
 
Example 5
Source File: Split.java    From hbase-tools with Apache License 2.0 4 votes vote down vote up
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
    return new RegionSplitter.UniformSplit();
}
 
Example 6
Source File: Split.java    From hbase-tools with Apache License 2.0 4 votes vote down vote up
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
    return new RegionSplitter.UniformSplit();
}
 
Example 7
Source File: Split.java    From hbase-tools with Apache License 2.0 4 votes vote down vote up
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
    return new RegionSplitter.UniformSplit();
}
 
Example 8
Source File: TestRegionReplicaSplit.java    From hbase with Apache License 2.0 4 votes vote down vote up
private static byte[][] getSplits(int numRegions) {
  RegionSplitter.UniformSplit split = new RegionSplitter.UniformSplit();
  split.setFirstRow(Bytes.toBytes(0L));
  split.setLastRow(Bytes.toBytes(Long.MAX_VALUE));
  return split.split(numRegions);
}
 
Example 9
Source File: TestRegionReplicasWithModifyTable.java    From hbase with Apache License 2.0 4 votes vote down vote up
private static byte[][] getSplits(int numRegions) {
  RegionSplitter.UniformSplit split = new RegionSplitter.UniformSplit();
  split.setFirstRow(Bytes.toBytes(0L));
  split.setLastRow(Bytes.toBytes(Long.MAX_VALUE));
  return split.split(numRegions);
}
 
Example 10
Source File: TestRegionReplicasWithRestartScenarios.java    From hbase with Apache License 2.0 4 votes vote down vote up
private static byte[][] getSplits(int numRegions) {
  RegionSplitter.UniformSplit split = new RegionSplitter.UniformSplit();
  split.setFirstRow(Bytes.toBytes(0L));
  split.setLastRow(Bytes.toBytes(Long.MAX_VALUE));
  return split.split(numRegions);
}
 
Example 11
Source File: TestRegionReplicasAreDistributed.java    From hbase with Apache License 2.0 4 votes vote down vote up
private static byte[][] getSplits(int numRegions) {
  RegionSplitter.UniformSplit split = new RegionSplitter.UniformSplit();
  split.setFirstRow(Bytes.toBytes(0L));
  split.setLastRow(Bytes.toBytes(Long.MAX_VALUE));
  return split.split(numRegions);
}
 
Example 12
Source File: IntegrationTestBulkLoad.java    From hbase with Apache License 2.0 4 votes vote down vote up
private byte[][] getSplits(int numRegions) {
  RegionSplitter.UniformSplit split = new RegionSplitter.UniformSplit();
  split.setFirstRow(Bytes.toBytes(0L));
  split.setLastRow(Bytes.toBytes(Long.MAX_VALUE));
  return split.split(numRegions);
}