Class BaseRowProcessorEndpoint<S extends com.google.protobuf.Message,T extends com.google.protobuf.Message>
java.lang.Object
org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService
org.apache.hadoop.hbase.coprocessor.BaseRowProcessorEndpoint<S,T>
- All Implemented Interfaces:
com.google.protobuf.Service,Coprocessor,RegionCoprocessor
@LimitedPrivate("Coprocesssor")
@Evolving
public abstract class BaseRowProcessorEndpoint<S extends com.google.protobuf.Message,T extends com.google.protobuf.Message>
extends org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService
implements RegionCoprocessor
This class demonstrates how to implement atomic read-modify-writes using
Region.processRowsWithLocks(org.apache.hadoop.hbase.regionserver.RowProcessor<?, ?>) and Coprocessor endpoints.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService
org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService.BlockingInterface, org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService.Interface, org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService.StubNested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State -
Field Summary
FieldsFields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) RowProcessor<S,T> constructRowProcessorFromRequest(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest request) Iterable<com.google.protobuf.Service>Coprocessor endpoints providing protobuf services should override this method.voidprocess(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessResponse> done) Pass a processor to region to process multiple rows atomically.voidStores a reference to the coprocessor environment provided by theRegionCoprocessorHostfrom the region where this coprocessor is loaded.voidCalled by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.Methods inherited from class org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService
callMethod, getDescriptor, getDescriptorForType, getRequestPrototype, getResponsePrototype, newBlockingStub, newReflectiveBlockingService, newReflectiveService, newStubMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionCoprocessor
getBulkLoadObserver, getEndpointObserver, getRegionObserver
-
Field Details
-
env
-
-
Constructor Details
-
BaseRowProcessorEndpoint
public BaseRowProcessorEndpoint()
-
-
Method Details
-
process
public void process(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessResponse> done) Pass a processor to region to process multiple rows atomically. The RowProcessor implementations should be the inner classes of your RowProcessorEndpoint. This way the RowProcessor can be class-loaded with the Coprocessor endpoint together. SeeTestRowProcessorEndpointfor example. The request contains information for constructing processor (seeconstructRowProcessorFromRequest(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest). The processor object defines the read-modify-write procedure.- Specified by:
processin classorg.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService
-
getServices
Description copied from interface:CoprocessorCoprocessor endpoints providing protobuf services should override this method.- Specified by:
getServicesin interfaceCoprocessor- Returns:
- Iterable of
Services or empty collection. Implementations should never return null.
-
start
Stores a reference to the coprocessor environment provided by theRegionCoprocessorHostfrom the region where this coprocessor is loaded. Since this is a coprocessor endpoint, it always expects to be loaded on a table region, so always expects this to be an instance ofRegionCoprocessorEnvironment.- Specified by:
startin interfaceCoprocessor- Parameters:
env- the environment provided by the coprocessor host- Throws:
IOException- if the provided environment is not an instance ofRegionCoprocessorEnvironment
-
stop
Description copied from interface:CoprocessorCalled by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.- Specified by:
stopin interfaceCoprocessor- Throws:
IOException
-
constructRowProcessorFromRequest
RowProcessor<S,T> constructRowProcessorFromRequest(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest request) throws IOException - Throws:
IOException
-