コード例 #1
0
ファイル: HRegionInfo.java プロジェクト: dobromyslov/hbase
 /**
  * Get the descriptive name as {@link RegionState} does it but with hidden startkey optionally
  *
  * @param state
  * @param conf
  * @return descriptive string
  */
 public static String getDescriptiveNameFromRegionStateForDisplay(
     RegionState state, Configuration conf) {
   if (conf.getBoolean(DISPLAY_KEYS_KEY, true)) return state.toDescriptiveString();
   String descriptiveStringFromState = state.toDescriptiveString();
   int idx = descriptiveStringFromState.lastIndexOf(" state=");
   String regionName = getRegionNameAsStringForDisplay(state.getRegion(), conf);
   return regionName + descriptiveStringFromState.substring(idx);
 }
コード例 #2
0
 @Override
 public ReportRegionStateTransitionResponse reportRegionStateTransition(
     RpcController c, ReportRegionStateTransitionRequest req) throws ServiceException {
   ReportRegionStateTransitionResponse resp = super.reportRegionStateTransition(c, req);
   if (enabled.get()
       && req.getTransition(0).getTransitionCode() == TransitionCode.READY_TO_MERGE
       && !resp.hasErrorMessage()) {
     RegionStates regionStates = myMaster.getAssignmentManager().getRegionStates();
     for (RegionState regionState : regionStates.getRegionsInTransition().values()) {
       // Find the merging_new region and remove it
       if (regionState.isMergingNew()) {
         regionStates.deleteRegion(regionState.getRegion());
       }
     }
   }
   return resp;
 }