Search in sources :

Example 1 with ServiceException

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);
    }
}
Also used : TableName(org.apache.hadoop.hbase.TableName) ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority)

Example 2 with ServiceException

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();
}
Also used : ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) ServerName(org.apache.hadoop.hbase.ServerName) ListDrainingRegionServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListDrainingRegionServersResponse) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 3 with ServiceException

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);
    }
}
Also used : ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 4 with ServiceException

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);
    }
}
Also used : ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 5 with ServiceException

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);
    }
}
Also used : ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) WarmupRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WarmupRegionRequest)

Aggregations

ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)28 IOException (java.io.IOException)15 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)10 ServerName (org.apache.hadoop.hbase.ServerName)9 ArrayList (java.util.ArrayList)5 HBaseRpcController (org.apache.hadoop.hbase.ipc.HBaseRpcController)5 AdminService (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService)5 InterruptedIOException (java.io.InterruptedIOException)4 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)4 ClusterConnection (org.apache.hadoop.hbase.client.ClusterConnection)4 TableName (org.apache.hadoop.hbase.TableName)3 QosPriority (org.apache.hadoop.hbase.ipc.QosPriority)3 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)2 RpcController (org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController)2 OpenRegionRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionRequest)2 OpenRegionResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionResponse)2 RegionServerStatusService (org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStatusService)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Message (com.google.protobuf.Message)1 RpcController (com.google.protobuf.RpcController)1