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
(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.
-
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
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 serviceioe
- 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
-