Search in sources :

Example 1 with ClearSlowLogResponses

use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponses in project hbase by apache.

the class HBaseRpcServicesBase method clearSlowLogsResponses.

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public ClearSlowLogResponses clearSlowLogsResponses(final RpcController controller, final ClearSlowLogResponseRequest request) throws ServiceException {
    try {
        requirePermission("clearSlowLogsResponses", Permission.Action.ADMIN);
    } catch (IOException e) {
        throw new ServiceException(e);
    }
    final NamedQueueRecorder namedQueueRecorder = this.server.getNamedQueueRecorder();
    boolean slowLogsCleaned = Optional.ofNullable(namedQueueRecorder).map(queueRecorder -> queueRecorder.clearNamedQueue(NamedQueuePayload.NamedQueueEvent.SLOW_LOG)).orElse(false);
    ClearSlowLogResponses clearSlowLogResponses = ClearSlowLogResponses.newBuilder().setIsCleaned(slowLogsCleaned).build();
    return clearSlowLogResponses;
}
Also used : NamedQueueRecorder(org.apache.hadoop.hbase.namequeues.NamedQueueRecorder) GetMastersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMastersRequest) SlowLogPayload(org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload) RequestHeader(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader) LoggerFactory(org.slf4j.LoggerFactory) RpcSchedulerFactory(org.apache.hadoop.hbase.regionserver.RpcSchedulerFactory) Message(org.apache.hbase.thirdparty.com.google.protobuf.Message) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) NamedQueueGetResponse(org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse) NamedQueueRecorder(org.apache.hadoop.hbase.namequeues.NamedQueueRecorder) Configuration(org.apache.hadoop.conf.Configuration) PriorityFunction(org.apache.hadoop.hbase.ipc.PriorityFunction) Method(java.lang.reflect.Method) Address(org.apache.hadoop.hbase.net.Address) NoopAccessChecker(org.apache.hadoop.hbase.security.access.NoopAccessChecker) ProtobufUtil(org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil) RpcLogDetails(org.apache.hadoop.hbase.namequeues.RpcLogDetails) ZKPermissionWatcher(org.apache.hadoop.hbase.security.access.ZKPermissionWatcher) GetBootstrapNodesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetBootstrapNodesRequest) ZKWatcher(org.apache.hadoop.hbase.zookeeper.ZKWatcher) SlowLogResponseRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponseRequest) GetMetaRegionLocationsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMetaRegionLocationsRequest) InetSocketAddress(java.net.InetSocketAddress) GetMetaRegionLocationsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMetaRegionLocationsResponse) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) ConfigurationObserver(org.apache.hadoop.hbase.conf.ConfigurationObserver) RpcServerInterface(org.apache.hadoop.hbase.ipc.RpcServerInterface) UpdateConfigurationResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationResponse) Optional(java.util.Optional) ClearSlowLogResponseRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponseRequest) GetActiveMasterResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetActiveMasterResponse) HBaseRPCErrorHandler(org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler) Permission(org.apache.hadoop.hbase.security.access.Permission) DNS(org.apache.hadoop.hbase.util.DNS) ByteBuffAllocator(org.apache.hadoop.hbase.io.ByteBuffAllocator) ReservoirSample(org.apache.hadoop.hbase.util.ReservoirSample) NamedQueueGetRequest(org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest) ConnectionUtils(org.apache.hadoop.hbase.client.ConnectionUtils) RpcController(org.apache.hbase.thirdparty.com.google.protobuf.RpcController) GetMastersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMastersResponse) BindException(java.net.BindException) User(org.apache.hadoop.hbase.security.User) ClearSlowLogResponses(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponses) UpdateConfigurationRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationRequest) GetBootstrapNodesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetBootstrapNodesResponse) GetClusterIdResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetClusterIdResponse) NamedQueuePayload(org.apache.hadoop.hbase.namequeues.NamedQueuePayload) GetMastersResponseEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMastersResponseEntry) RpcServer(org.apache.hadoop.hbase.ipc.RpcServer) SlowLogResponses(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponses) Logger(org.slf4j.Logger) HBaseProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos) KeeperException(org.apache.zookeeper.KeeperException) GetClusterIdRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetClusterIdRequest) AdminService(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService) GetActiveMasterRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetActiveMasterRequest) IOException(java.io.IOException) ClientMetaService(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.ClientMetaService) RpcServerFactory(org.apache.hadoop.hbase.ipc.RpcServerFactory) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority) OOMEChecker(org.apache.hadoop.hbase.util.OOMEChecker) InterfaceAudience(org.apache.yetus.audience.InterfaceAudience) BlockingServiceAndInterface(org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface) AccessChecker(org.apache.hadoop.hbase.security.access.AccessChecker) RpcScheduler(org.apache.hadoop.hbase.ipc.RpcScheduler) ByteString(org.apache.hbase.thirdparty.com.google.protobuf.ByteString) Collections(java.util.Collections) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) IOException(java.io.IOException) ClearSlowLogResponses(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearSlowLogResponses) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority)

Aggregations

IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 BindException (java.net.BindException)1 InetSocketAddress (java.net.InetSocketAddress)1 Collections (java.util.Collections)1 List (java.util.List)1 Optional (java.util.Optional)1 Configuration (org.apache.hadoop.conf.Configuration)1 ConnectionUtils (org.apache.hadoop.hbase.client.ConnectionUtils)1 ConfigurationObserver (org.apache.hadoop.hbase.conf.ConfigurationObserver)1 ByteBuffAllocator (org.apache.hadoop.hbase.io.ByteBuffAllocator)1 HBaseRPCErrorHandler (org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler)1 PriorityFunction (org.apache.hadoop.hbase.ipc.PriorityFunction)1 QosPriority (org.apache.hadoop.hbase.ipc.QosPriority)1 RpcScheduler (org.apache.hadoop.hbase.ipc.RpcScheduler)1 RpcServer (org.apache.hadoop.hbase.ipc.RpcServer)1 BlockingServiceAndInterface (org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface)1 RpcServerFactory (org.apache.hadoop.hbase.ipc.RpcServerFactory)1 RpcServerInterface (org.apache.hadoop.hbase.ipc.RpcServerInterface)1