Package org.apache.hadoop.hbase
Interface Coprocessor
- All Known Subinterfaces:
MasterCoprocessor,RegionCoprocessor,RegionServerCoprocessor,WALCoprocessor
- All Known Implementing Classes:
AccessController,BackupObserver,BaseRowProcessorEndpoint,BulkDeleteEndpoint,ConstraintProcessor,CoprocessorServiceBackwardCompatiblity.MasterCoprocessorService,CoprocessorServiceBackwardCompatiblity.RegionCoprocessorService,CoprocessorServiceBackwardCompatiblity.RegionServerCoprocessorService,CoprocessorWhitelistMasterObserver,ExampleMasterObserverWithMetrics,ExampleRegionObserverWithMetrics,ExampleRegionObserverWithMetrics.ExampleRegionObserver,JMXListener,MasterQuotasObserver,MetaTableMetrics,MetaTableMetrics.ExampleRegionObserverMeta,MultiRowMutationEndpoint,RefreshHFilesEndpoint,ReplicationObserver,RowCountEndpoint,RSGroupAdminEndpoint,ScanModifyingObserver,SnapshotScannerHDFSAclController,TokenProvider,ValueRewritingObserver,VisibilityController,VisibilityReplication,WriteHeavyIncrementObserver,WriteSinkCoprocessor,ZooKeeperScanPolicyObserver
Base interface for the 4 coprocessors - MasterCoprocessor, RegionCoprocessor,
RegionServerCoprocessor, and WALCoprocessor. Do NOT implement this interface directly. Unless an
implementation implements one (or more) of the above mentioned 4 coprocessors, it'll fail to be
loaded by any coprocessor host. Example: Building a coprocessor to observe Master operations.
class MyMasterCoprocessor implements MasterCoprocessor {
@Override
public Optional<MasterObserver> getMasterObserver() {
return new MyMasterObserver();
}
}
class MyMasterObserver implements MasterObserver {
....
}
Building a Service which can be loaded by both Master and RegionServer
class MyCoprocessorService implements MasterCoprocessor, RegionServerCoprocessor {
@Override
public Optional<Service> getServices() {
return new ...;
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumLifecycle state of a given coprocessor instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHighest installation prioritystatic final intLowest installation prioritystatic final intHigh (system) installation prioritystatic final intDefault installation priority for user coprocessorsstatic final int -
Method Summary
Modifier and TypeMethodDescriptiondefault Iterable<com.google.protobuf.Service>Coprocessor endpoints providing protobuf services should override this method.default voidCalled by theCoprocessorEnvironmentduring it's own startup to initialize the coprocessor.default voidCalled by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.
-
Field Details
-
VERSION
- See Also:
-
PRIORITY_HIGHEST
Highest installation priority- See Also:
-
PRIORITY_SYSTEM
High (system) installation priority- See Also:
-
PRIORITY_USER
Default installation priority for user coprocessors- See Also:
-
PRIORITY_LOWEST
Lowest installation priority- See Also:
-
-
Method Details
-
start
Called by theCoprocessorEnvironmentduring it's own startup to initialize the coprocessor.- Throws:
IOException
-
stop
Called by theCoprocessorEnvironmentduring it's own shutdown to stop the coprocessor.- Throws:
IOException
-
getServices
Coprocessor endpoints providing protobuf services should override this method.- Returns:
- Iterable of
Services or empty collection. Implementations should never return null.
-