Package org.apache.hadoop.hbase.ipc
Class CoprocessorRpcUtils
java.lang.Object
org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils
Utilities for handling coprocessor rpc service calls.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SimpleRpcCallback
implementation providing aFuture
-likeCoprocessorRpcUtils.BlockingRpcCallback.get()
method, which will block util the instance'sCoprocessorRpcUtils.BlockingRpcCallback.run(Object)
method has been called. -
Field Summary
Modifier and TypeFieldDescriptionprivate 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic IOException
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.
-
Field Details
-
LOG
-
hbaseServicePackage
We assume that all HBase protobuf services share a common package name (defined in the .proto files).
-
-
Constructor Details
-
CoprocessorRpcUtils
private CoprocessorRpcUtils()
-
-
Method Details
-
getServiceName
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 serviceioe
- 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
-