use of org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method compactRegion.
/**
* 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 = HRegionInfo.getTable(regionName);
// if the region is a mob region, do the mob file compaction.
if (MobUtils.isMobRegionName(tableName, regionName)) {
return compactMob(request, tableName);
} else {
return super.compactRegion(controller, request);
}
} catch (IOException ie) {
throw new ServiceException(ie);
}
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method listDrainingRegionServers.
@Override
public ListDrainingRegionServersResponse listDrainingRegionServers(RpcController controller, ListDrainingRegionServersRequest request) throws ServiceException {
ListDrainingRegionServersResponse.Builder response = ListDrainingRegionServersResponse.newBuilder();
try {
master.checkInitialized();
List<ServerName> servers = master.listDrainingRegionServers();
for (ServerName server : servers) {
response.addServerName(ProtobufUtil.toServerName(server));
}
} catch (IOException io) {
throw new ServiceException(io);
}
return response.build();
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method setNormalizerRunning.
@Override
public SetNormalizerRunningResponse setNormalizerRunning(RpcController controller, SetNormalizerRunningRequest request) throws ServiceException {
try {
master.checkInitialized();
boolean prevValue = normalizerSwitch(request.getOn());
return SetNormalizerRunningResponse.newBuilder().setPrevNormalizerValue(prevValue).build();
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method runCleanerChore.
@Override
public RunCleanerChoreResponse runCleanerChore(RpcController c, RunCleanerChoreRequest req) throws ServiceException {
try {
master.checkInitialized();
Boolean result = master.getHFileCleaner().runCleaner() && master.getLogCleaner().runCleaner();
return ResponseConverter.buildRunCleanerChoreResponse(result);
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
use of org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException in project hbase by apache.
the class ProtobufUtil method warmupRegion.
/**
* A helper to warmup a region given a region name
* using admin protocol
*
* @param admin
* @param regionInfo
*
*/
public static void warmupRegion(final RpcController controller, final AdminService.BlockingInterface admin, final HRegionInfo regionInfo) throws IOException {
try {
WarmupRegionRequest warmupRegionRequest = RequestConverter.buildWarmupRegionRequest(regionInfo);
admin.warmupRegion(controller, warmupRegionRequest);
} catch (ServiceException e) {
throw getRemoteException(e);
}
}
Aggregations