Java 类org.apache.hadoop.hbase.regionserver.RegionSplitPolicy 实例源码

项目:hbase    文件:SplitTableRegionProcedure.java   
public SplitTableRegionProcedure(final MasterProcedureEnv env,
    final RegionInfo regionToSplit, final byte[] splitRow) throws IOException {
  super(env, regionToSplit);
  this.bestSplitRow = splitRow;
  checkSplittable(env, regionToSplit, bestSplitRow);
  final TableName table = regionToSplit.getTable();
  final long rid = getDaughterRegionIdTimestamp(regionToSplit);
  this.daughter_1_RI = RegionInfoBuilder.newBuilder(table)
      .setStartKey(regionToSplit.getStartKey())
      .setEndKey(bestSplitRow)
      .setSplit(false)
      .setRegionId(rid)
      .build();
  this.daughter_2_RI = RegionInfoBuilder.newBuilder(table)
      .setStartKey(bestSplitRow)
      .setEndKey(regionToSplit.getEndKey())
      .setSplit(false)
      .setRegionId(rid)
      .build();
  TableDescriptor htd = env.getMasterServices().getTableDescriptors().get(getTableName());
  if(htd.getRegionSplitPolicyClassName() != null) {
    // Since we don't have region reference here, creating the split policy instance without it.
    // This can be used to invoke methods which don't require Region reference. This instantiation
    // of a class on Master-side though it only makes sense on the RegionServer-side is
    // for Phoenix Local Indexing. Refer HBASE-12583 for more information.
    Class<? extends RegionSplitPolicy> clazz =
        RegionSplitPolicy.getSplitPolicyClass(htd, env.getMasterConfiguration());
    this.splitPolicy = ReflectionUtils.newInstance(clazz, env.getMasterConfiguration());
  }
}
项目:ditb    文件:HMaster.java   
private void checkClassLoading(final Configuration conf, final HTableDescriptor htd)
throws IOException {
  RegionSplitPolicy.getSplitPolicyClass(htd, conf);
  RegionCoprocessorHost.testTableCoprocessorAttrs(conf, htd);
}
项目:pbase    文件:HMaster.java   
private void checkClassLoading(final Configuration conf, final HTableDescriptor htd)
        throws IOException {
    RegionSplitPolicy.getSplitPolicyClass(htd, conf);
    RegionCoprocessorHost.testTableCoprocessorAttrs(conf, htd);
}
项目:hbase    文件:HMaster.java   
private void checkClassLoading(final Configuration conf, final TableDescriptor htd)
throws IOException {
  RegionSplitPolicy.getSplitPolicyClass(htd, conf);
  RegionCoprocessorHost.testTableCoprocessorAttrs(conf, htd);
}