hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
/**
   * Compact a region on the master.
   *
   * @param controller the RPC controller
   * @param request the request
   * @throws ServiceException
   */
Compact a region on the master.
@param controller the RPC controller
@param request the request
@throws ServiceException
Compact a region on the master . @param controller the RPC controller @param request the request @throws ServiceException
@Override
  @QosPriority(priority=HConstants.ADMIN_QOS)
  public CompactRegionResponse compactRegion(final RpcController controller,
    final CompactRegionRequest request) throws ServiceException {
    try {
      master.checkInitialized();
      byte[] regionName = request.getRegion().getValue().toByteArray();
      TableName tableName = RegionInfo.getTable(regionName);
      if (MobUtils.isMobRegionName(tableName, regionName)) {
        checkHFileFormatVersionForMob();
        return compactMob(request, tableName);
      } else {
        return super.compactRegion(controller, request);
      }
    } catch (IOException ie) {
      throw new ServiceException(ie);
    }
  }
@ Override @ QosPriority ( priority = HConstants . ADMIN_QOS ) public CompactRegionResponse compactRegion ( final RpcController controller , final CompactRegionRequest request ) throws ServiceException { try { master . checkInitialized ( ) ; byte [ ] regionName = request . getRegion ( ) . getValue ( ) . toByteArray ( ) ; TableName tableName = RegionInfo . getTable ( regionName ) ; if ( MobUtils . isMobRegionName ( tableName , regionName ) ) { checkHFileFormatVersionForMob ( ) ; return compactMob ( request , tableName ) ; } else { return super . compactRegion ( controller , request ) ; } } catch ( IOException ie ) { throw new ServiceException ( ie ) ; } }
Compact a region on the master.
Compact a region on the master .
// if the region is a mob region, do the mob file compaction.