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

项目:pbase    文件:TestRegionServerObserver.java   
@Override
public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
    HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException {
  preMergeBeforePONRCalled = true;
  RegionServerCoprocessorEnvironment environment = ctx.getEnvironment();
  HRegionServer rs = (HRegionServer) environment.getRegionServerServices();
  List<HRegion> onlineRegions =
      rs.getOnlineRegions(TableName.valueOf("testRegionServerObserver_2"));
  rmt = new RegionMergeTransaction(onlineRegions.get(0), onlineRegions.get(1), true);
  if (!rmt.prepare(rs)) {
    LOG.error("Prepare for the region merge of table "
        + onlineRegions.get(0).getTableDesc().getNameAsString()
        + " failed. So returning null. ");
    ctx.bypass();
    return;
  }
  mergedRegion = rmt.stepsBeforePONR(rs, rs, false);
  rmt.prepareMutationsForMerge(mergedRegion.getRegionInfo(), regionA.getRegionInfo(),
    regionB.getRegionInfo(), rs.getServerName(), metaEntries);
  MetaTableAccessor.mutateMetaTable(rs.getConnection(), metaEntries);
}
项目:HIndex    文件:TestRegionServerObserver.java   
@Override
public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
    HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException {
  preMergeBeforePONRCalled = true;
  RegionServerCoprocessorEnvironment environment = ctx.getEnvironment();
  HRegionServer rs = (HRegionServer) environment.getRegionServerServices();
  List<HRegion> onlineRegions =
      rs.getOnlineRegions(TableName.valueOf("testRegionServerObserver_2"));
  rmt = new RegionMergeTransaction(onlineRegions.get(0), onlineRegions.get(1), true);
  if (!rmt.prepare(rs)) {
    LOG.error("Prepare for the region merge of table "
        + onlineRegions.get(0).getTableDesc().getNameAsString()
        + " failed. So returning null. ");
    ctx.bypass();
    return;
  }
  mergedRegion = rmt.stepsBeforePONR(rs, rs, false);
  rmt.prepareMutationsForMerge(mergedRegion.getRegionInfo(), regionA.getRegionInfo(),
    regionB.getRegionInfo(), rs.getServerName(), metaEntries);
  MetaEditor.mutateMetaTable(rs.getCatalogTracker(), metaEntries);
}
项目:PyroDB    文件:TestRegionServerObserver.java   
@Override
public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
    HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException {
  preMergeBeforePONRCalled = true;
  RegionServerCoprocessorEnvironment environment = ctx.getEnvironment();
  HRegionServer rs = (HRegionServer) environment.getRegionServerServices();
  List<HRegion> onlineRegions =
      rs.getOnlineRegions(TableName.valueOf("testRegionServerObserver_2"));
  rmt = new RegionMergeTransaction(onlineRegions.get(0), onlineRegions.get(1), true);
  if (!rmt.prepare(rs)) {
    LOG.error("Prepare for the region merge of table "
        + onlineRegions.get(0).getTableDesc().getNameAsString()
        + " failed. So returning null. ");
    ctx.bypass();
    return;
  }
  mergedRegion = rmt.stepsBeforePONR(rs, rs, false);
  rmt.prepareMutationsForMerge(mergedRegion.getRegionInfo(), regionA.getRegionInfo(),
    regionB.getRegionInfo(), rs.getServerName(), metaEntries);
  MetaEditor.mutateMetaTable(rs.getCatalogTracker(), metaEntries);
}