@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 ...;
}
}
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
Coprocessor.State
Lifecycle state of a given coprocessor instance.
|
| 限定符和类型 | 字段和说明 |
|---|---|
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 |
| 限定符和类型 | 方法和说明 |
|---|---|
default Iterable<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.IOExceptiondefault void stop(CoprocessorEnvironment env) throws IOException
CoprocessorEnvironment during it's own shutdown to stop the
coprocessor.IOExceptionCopyright © 2007–2019. All rights reserved.