本文整理汇总了Java中org.apache.hadoop.hbase.util.RegionSplitter.UniformSplit方法的典型用法代码示例。如果您正苦于以下问题:Java RegionSplitter.UniformSplit方法的具体用法?Java RegionSplitter.UniformSplit怎么用?Java RegionSplitter.UniformSplit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.util.RegionSplitter
的用法示例。
在下文中一共展示了RegionSplitter.UniformSplit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateRegionSplits
import org.apache.hadoop.hbase.util.RegionSplitter; //导入方法依赖的package包/类
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];
}
}
示例2: getSplits
import org.apache.hadoop.hbase.util.RegionSplitter; //导入方法依赖的package包/类
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);
}
示例3: createSplitter
import org.apache.hadoop.hbase.util.RegionSplitter; //导入方法依赖的package包/类
@Override
public RegionSplitter.SplitAlgorithm createSplitter(int cardinality) {
return new RegionSplitter.UniformSplit();
}
示例4: getSplits
import org.apache.hadoop.hbase.util.RegionSplitter; //导入方法依赖的package包/类
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);
}