@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.StateLifecycle state of a given coprocessor instance. | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | PRIORITY_HIGHESTHighest installation priority | 
| static int | PRIORITY_LOWESTLowest installation priority | 
| static int | PRIORITY_SYSTEMHigh (system) installation priority | 
| static int | PRIORITY_USERDefault 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  CoprocessorEnvironmentduring it's own startup to initialize the
 coprocessor. | 
| default void | stop(CoprocessorEnvironment env)Called by the  CoprocessorEnvironmentduring 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.IOExceptiondefault Iterable<com.google.protobuf.Service> getServices()
Services or empty collection. Implementations should never
 return null.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.