Class CoprocessorRpcUtils

java.lang.Object
org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils

@Private public final class CoprocessorRpcUtils extends Object
Utilities for handling coprocessor rpc service calls.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Simple RpcCallback implementation providing a Future-like CoprocessorRpcUtils.BlockingRpcCallback.get() method, which will block util the instance's CoprocessorRpcUtils.BlockingRpcCallback.run(Object) method has been called.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    We assume that all HBase protobuf services share a common package name (defined in the .proto files).
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getControllerException(com.google.protobuf.RpcController controller)
    Retreivies exception stored during RPC invocation.
    private static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceCall
    getCoprocessorServiceCall(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request, byte[] row)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest
    getCoprocessorServiceRequest(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest
    getCoprocessorServiceRequest(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request, byte[] row, byte[] regionName)
     
    static com.google.protobuf.Descriptors.MethodDescriptor
    getMethodDescriptor(String methodName, com.google.protobuf.Descriptors.ServiceDescriptor serviceDesc)
     
    static com.google.protobuf.Message
    getRequest(com.google.protobuf.Service service, com.google.protobuf.Descriptors.MethodDescriptor methodDesc, org.apache.hbase.thirdparty.com.google.protobuf.ByteString shadedRequest)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse
    getResponse(com.google.protobuf.Message result, byte[] regionName)
     
    static com.google.protobuf.Message
    getResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, com.google.protobuf.Message responsePrototype)
     
    static String
    getServiceName(com.google.protobuf.Descriptors.ServiceDescriptor service)
    Returns the name to use for coprocessor service calls.
    static void
    setControllerException(com.google.protobuf.RpcController controller, IOException ioe)
    Stores an exception encountered during RPC invocation so it can be passed back through to the client.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • hbaseServicePackage

      private static final String hbaseServicePackage
      We assume that all HBase protobuf services share a common package name (defined in the .proto files).
  • Constructor Details

  • Method Details

    • getServiceName

      public static String getServiceName(com.google.protobuf.Descriptors.ServiceDescriptor service)
      Returns the name to use for coprocessor service calls. For core HBase services (in the hbase.pb protobuf package), this returns the unqualified name in order to provide backward compatibility across the package name change. For all other services, the fully-qualified service name is used.
    • getCoprocessorServiceRequest

      public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest getCoprocessorServiceRequest(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request)
    • getCoprocessorServiceRequest

      public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest getCoprocessorServiceRequest(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request, byte[] row, byte[] regionName)
    • getCoprocessorServiceCall

      private static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceCall getCoprocessorServiceCall(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message request, byte[] row)
    • getMethodDescriptor

      public static com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor(String methodName, com.google.protobuf.Descriptors.ServiceDescriptor serviceDesc) throws UnknownProtocolException
      Throws:
      UnknownProtocolException
    • getRequest

      public static com.google.protobuf.Message getRequest(com.google.protobuf.Service service, com.google.protobuf.Descriptors.MethodDescriptor methodDesc, org.apache.hbase.thirdparty.com.google.protobuf.ByteString shadedRequest) throws IOException
      Throws:
      IOException
    • getResponse

      public static com.google.protobuf.Message getResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, com.google.protobuf.Message responsePrototype) throws IOException
      Throws:
      IOException
    • getResponse

      public static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse getResponse(com.google.protobuf.Message result, byte[] regionName)
    • setControllerException

      public static void setControllerException(com.google.protobuf.RpcController controller, IOException ioe)
      Stores an exception encountered during RPC invocation so it can be passed back through to the client.
      Parameters:
      controller - the controller instance provided by the client when calling the service
      ioe - the exception encountered
    • getControllerException

      @Nullable public static IOException getControllerException(com.google.protobuf.RpcController controller) throws IOException
      Retreivies exception stored during RPC invocation.
      Parameters:
      controller - the controller instance provided by the client when calling the service
      Returns:
      exception if any, or null; Will return DoNotRetryIOException for string represented failure causes in controller.
      Throws:
      IOException