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(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller)
    Retreivies exception stored during RPC invocation.
    private static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceCall
    getCoprocessorServiceCall(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method, org.apache.hbase.thirdparty.com.google.protobuf.Message request, byte[] row)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest
    getCoprocessorServiceRequest(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method, org.apache.hbase.thirdparty.com.google.protobuf.Message request)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest
    getCoprocessorServiceRequest(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method, org.apache.hbase.thirdparty.com.google.protobuf.Message request, byte[] row, byte[] regionName)
     
    static org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor
    getMethodDescriptor(String methodName, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.ServiceDescriptor serviceDesc)
     
    static org.apache.hbase.thirdparty.com.google.protobuf.Message
    getRequest(org.apache.hbase.thirdparty.com.google.protobuf.Service service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor methodDesc, org.apache.hbase.thirdparty.com.google.protobuf.ByteString shadedRequest)
     
    static org.apache.hbase.thirdparty.com.google.protobuf.Message
    getResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, org.apache.hbase.thirdparty.com.google.protobuf.Message responsePrototype)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse
    getResponse(org.apache.hbase.thirdparty.com.google.protobuf.Message result, byte[] regionName)
     
    static String
    getServiceName(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.ServiceDescriptor service)
    Returns the name to use for coprocessor service calls.
    static void
    setControllerException(org.apache.hbase.thirdparty.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(org.apache.hbase.thirdparty.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(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method, org.apache.hbase.thirdparty.com.google.protobuf.Message request)
    • getCoprocessorServiceRequest

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

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

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

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

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

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

      public static void setControllerException(org.apache.hbase.thirdparty.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(org.apache.hbase.thirdparty.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