E
- The CoprocessorEnvironment
subclass applicable to the
revelant Observer interface.@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public class ObserverContext<E extends CoprocessorEnvironment> extends Object
RegionObserver
, MasterObserver
, or WALObserver
)
method. The same ObserverContext instance is passed sequentially to all loaded
coprocessors for a given Observer method trigger, with the
CoprocessorEnvironment
reference swapped out for each
coprocessor.Modifier and Type | Field and Description |
---|---|
private boolean |
bypass |
private boolean |
complete |
private E |
env |
Constructor and Description |
---|
ObserverContext() |
Modifier and Type | Method and Description |
---|---|
void |
bypass()
Call to indicate that the current coprocessor's return value should be
used in place of the normal HBase obtained value.
|
void |
complete()
Call to indicate that additional coprocessors further down the execution
chain do not need to be invoked.
|
static <T extends CoprocessorEnvironment> |
createAndPrepare(T env,
ObserverContext<T> context)
Instantiates a new ObserverContext instance if the passed reference is
null and sets the environment in the new or existing instance. |
E |
getEnvironment() |
void |
prepare(E env) |
boolean |
shouldBypass()
For use by the coprocessor framework.
|
boolean |
shouldComplete()
For use by the coprocessor framework.
|
private E extends CoprocessorEnvironment env
private boolean bypass
private boolean complete
public E getEnvironment()
public void prepare(E env)
public void bypass()
public void complete()
public boolean shouldBypass()
true
if bypass()
was called by one of the loaded coprocessors, false
otherwise.public boolean shouldComplete()
true
if complete()
was called by one of the loaded coprocessors, false
otherwise.public static <T extends CoprocessorEnvironment> ObserverContext<T> createAndPrepare(T env, ObserverContext<T> context)
null
and sets the environment in the new or existing instance.
This allows deferring the instantiation of a ObserverContext until it is
actually needed.T
- The environment type for the contextenv
- The coprocessor environment to setcontext
- An existing ObserverContext instance to use, or null
to create a new instanceObserverContext
with the environment setCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.