|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.coprocessor.ObserverContext<E>
E
- The CoprocessorEnvironment
subclass applicable to the
revelant Observer interface.@InterfaceAudience.Public @InterfaceStability.Evolving public class ObserverContext<E extends CoprocessorEnvironment>
Carries the execution state for a given invocation of an Observer coprocessor
(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.
Constructor Summary | |
---|---|
ObserverContext()
|
Method Summary | ||
---|---|---|
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
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObserverContext()
Method Detail |
---|
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 instance
ObserverContext
with the environment set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |