@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public class BaseWALObserver extends Object implements WALObserver
Coprocessor.StatePRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Constructor and Description |
|---|
BaseWALObserver() |
| Modifier and Type | Method and Description |
|---|---|
void |
postWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
HRegionInfo info,
WALKey logKey,
WALEdit logEdit)
Implementers should override this method and leave the deprecated version as-is.
|
void |
postWALWrite(ObserverContext<WALCoprocessorEnvironment> ctx,
HRegionInfo info,
HLogKey logKey,
WALEdit logEdit)
Called after a
WALEdit
is writen to WAL. |
boolean |
preWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
HRegionInfo info,
WALKey logKey,
WALEdit logEdit)
Implementers should override this method and leave the deprecated version as-is.
|
boolean |
preWALWrite(ObserverContext<WALCoprocessorEnvironment> ctx,
HRegionInfo info,
HLogKey logKey,
WALEdit logEdit)
Called before a
WALEdit
is writen to WAL. |
void |
start(CoprocessorEnvironment e) |
void |
stop(CoprocessorEnvironment e) |
public void start(CoprocessorEnvironment e) throws IOException
start in interface CoprocessorIOExceptionpublic void stop(CoprocessorEnvironment e) throws IOException
stop in interface CoprocessorIOExceptionpublic boolean preWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx, HRegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException
preWALWrite in interface WALObserverIOExceptionpublic boolean preWALWrite(ObserverContext<WALCoprocessorEnvironment> ctx, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException
WALObserverWALEdit
is writen to WAL.
This method is left in place to maintain binary compatibility with older
WALObservers. If an implementation directly overrides
WALObserver.preWALWrite(ObserverContext, HRegionInfo, WALKey, WALEdit) then this version
won't be called at all, barring problems with the Security Manager. To work correctly
in the presence of a strict Security Manager, or in the case of an implementation that
relies on a parent class to implement preWALWrite, you should implement this method
as a call to the non-deprecated version.
Users of this method will see all edits that can be treated as HLogKey. If there are
edits that can't be treated as HLogKey they won't be offered to coprocessors that rely
on this method. If a coprocessor gets skipped because of this mechanism, a log message
at ERROR will be generated per coprocessor on the logger for CoprocessorHost once per
classloader.preWALWrite in interface WALObserverIOExceptionpublic void postWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx, HRegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException
postWALWrite in interface WALObserverIOExceptionpublic void postWALWrite(ObserverContext<WALCoprocessorEnvironment> ctx, HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException
WALObserverWALEdit
is writen to WAL.
This method is left in place to maintain binary compatibility with older
WALObservers. If an implementation directly overrides
WALObserver.postWALWrite(ObserverContext, HRegionInfo, WALKey, WALEdit) then this version
won't be called at all, barring problems with the Security Manager. To work correctly
in the presence of a strict Security Manager, or in the case of an implementation that
relies on a parent class to implement preWALWrite, you should implement this method
as a call to the non-deprecated version.
Users of this method will see all edits that can be treated as HLogKey. If there are
edits that can't be treated as HLogKey they won't be offered to coprocessors that rely
on this method. If a coprocessor gets skipped because of this mechanism, a log message
at ERROR will be generated per coprocessor on the logger for CoprocessorHost once per
classloader.postWALWrite in interface WALObserverIOExceptionCopyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.