Java 类org.apache.hadoop.hbase.protobuf.generated.MasterProtos.OfflineRegionResponse 实例源码

项目:ditb    文件:MasterRpcServices.java   
/**
 * Offline specified region from master's in-memory state. It will not attempt to
 * reassign the region as in unassign.
 *
 * This is a special method that should be used by experts or hbck.
 *
 */
@Override
public OfflineRegionResponse offlineRegion(RpcController controller,
    OfflineRegionRequest request) throws ServiceException {
  final byte [] regionName = request.getRegion().getValue().toByteArray();
  RegionSpecifierType type = request.getRegion().getType();
  if (type != RegionSpecifierType.REGION_NAME) {
    LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
      + " actual: " + type);
  }

  try {
    master.checkInitialized();
    Pair<HRegionInfo, ServerName> pair =
      MetaTableAccessor.getRegion(master.getConnection(), regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
    HRegionInfo hri = pair.getFirst();
    if (master.cpHost != null) {
      master.cpHost.preRegionOffline(hri);
    }
    LOG.info(master.getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
    master.assignmentManager.regionOffline(hri);
    if (master.cpHost != null) {
      master.cpHost.postRegionOffline(hri);
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return OfflineRegionResponse.newBuilder().build();
}
项目:pbase    文件:MasterRpcServices.java   
/**
 * Offline specified region from master's in-memory state. It will not attempt to
 * reassign the region as in unassign.
 *
 * This is a special method that should be used by experts or hbck.
 *
 */
@Override
public OfflineRegionResponse offlineRegion(RpcController controller,
    OfflineRegionRequest request) throws ServiceException {
  final byte [] regionName = request.getRegion().getValue().toByteArray();
  RegionSpecifierType type = request.getRegion().getType();
  if (type != RegionSpecifierType.REGION_NAME) {
    LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
      + " actual: " + type);
  }

  try {
    master.checkInitialized();
    Pair<HRegionInfo, ServerName> pair =
      MetaTableAccessor.getRegion(master.getConnection(), regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
    HRegionInfo hri = pair.getFirst();
    if (master.cpHost != null) {
      master.cpHost.preRegionOffline(hri);
    }
    LOG.info(master.getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
    master.assignmentManager.regionOffline(hri);
    if (master.cpHost != null) {
      master.cpHost.postRegionOffline(hri);
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return OfflineRegionResponse.newBuilder().build();
}
项目:HIndex    文件:HMaster.java   
/**
 * Offline specified region from master's in-memory state. It will not attempt to
 * reassign the region as in unassign.
 *
 * This is a special method that should be used by experts or hbck.
 *
 */
@Override
public OfflineRegionResponse offlineRegion(RpcController controller, OfflineRegionRequest request)
throws ServiceException {
  final byte [] regionName = request.getRegion().getValue().toByteArray();
  RegionSpecifierType type = request.getRegion().getType();
  if (type != RegionSpecifierType.REGION_NAME) {
    LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
      + " actual: " + type);
  }

  try {
    Pair<HRegionInfo, ServerName> pair =
      MetaReader.getRegion(this.catalogTracker, regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
    HRegionInfo hri = pair.getFirst();
    if (cpHost != null) {
      cpHost.preRegionOffline(hri);
    }
    LOG.info(getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
    this.assignmentManager.regionOffline(hri);
    if (cpHost != null) {
      cpHost.postRegionOffline(hri);
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return OfflineRegionResponse.newBuilder().build();
}
项目:PyroDB    文件:MasterRpcServices.java   
/**
 * Offline specified region from master's in-memory state. It will not attempt to
 * reassign the region as in unassign.
 *
 * This is a special method that should be used by experts or hbck.
 *
 */
@Override
public OfflineRegionResponse offlineRegion(RpcController controller,
    OfflineRegionRequest request) throws ServiceException {
  final byte [] regionName = request.getRegion().getValue().toByteArray();
  RegionSpecifierType type = request.getRegion().getType();
  if (type != RegionSpecifierType.REGION_NAME) {
    LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
      + " actual: " + type);
  }

  try {
    master.checkInitialized();
    Pair<HRegionInfo, ServerName> pair =
      MetaReader.getRegion(master.getCatalogTracker(), regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
    HRegionInfo hri = pair.getFirst();
    if (master.cpHost != null) {
      master.cpHost.preRegionOffline(hri);
    }
    LOG.info(master.getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
    master.assignmentManager.regionOffline(hri);
    if (master.cpHost != null) {
      master.cpHost.postRegionOffline(hri);
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return OfflineRegionResponse.newBuilder().build();
}
项目:c5    文件:HMaster.java   
/**
 * Offline specified region from master's in-memory state. It will not attempt to
 * reassign the region as in unassign.
 *
 * This is a special method that should be used by experts or hbck.
 *
 */
@Override
public OfflineRegionResponse offlineRegion(RpcController controller, OfflineRegionRequest request)
throws ServiceException {
  final byte [] regionName = request.getRegion().getValue().toByteArray();
  RegionSpecifierType type = request.getRegion().getType();
  if (type != RegionSpecifierType.REGION_NAME) {
    LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
      + " actual: " + type);
  }

  try {
    Pair<HRegionInfo, ServerName> pair =
      MetaReader.getRegion(this.catalogTracker, regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
    HRegionInfo hri = pair.getFirst();
    if (cpHost != null) {
      cpHost.preRegionOffline(hri);
    }
    LOG.info(getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
    this.assignmentManager.regionOffline(hri);
    if (cpHost != null) {
      cpHost.postRegionOffline(hri);
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return OfflineRegionResponse.newBuilder().build();
}