@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public interface Coprocessor
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 ...; } }
Modifier and Type | Interface and Description |
---|---|
static class |
Coprocessor.State
Lifecycle state of a given coprocessor instance.
|
Modifier and Type | Field and Description |
---|---|
static int |
PRIORITY_HIGHEST
Highest installation priority
|
static int |
PRIORITY_LOWEST
Lowest installation priority
|
static int |
PRIORITY_SYSTEM
High (system) installation priority
|
static int |
PRIORITY_USER
Default installation priority for user coprocessors
|
static int |
VERSION |
Modifier and Type | Method and Description |
---|---|
default Iterable<com.google.protobuf.Service> |
getServices()
Coprocessor endpoints providing protobuf services should override this method.
|
default void |
start(CoprocessorEnvironment env)
Called by the
CoprocessorEnvironment during it's own startup to initialize the
coprocessor. |
default void |
stop(CoprocessorEnvironment env)
Called by the
CoprocessorEnvironment during it's own shutdown to stop the coprocessor. |
static final int VERSION
static final int PRIORITY_HIGHEST
static final int PRIORITY_SYSTEM
static final int PRIORITY_USER
static final int PRIORITY_LOWEST
default void start(CoprocessorEnvironment env) throws IOException
CoprocessorEnvironment
during it's own startup to initialize the
coprocessor.IOException
default void stop(CoprocessorEnvironment env) throws IOException
CoprocessorEnvironment
during it's own shutdown to stop the coprocessor.IOException
default Iterable<com.google.protobuf.Service> getServices()
Service
s or empty collection. Implementations should never return
null.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.