@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 |
postWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
Called after rolling the current WAL
|
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. |
void |
preWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
Called before rolling the current 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 WALObserverIOExceptionpublic void preWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException
WALObserverpreWALRoll in interface WALObserveroldPath - the path of the current wal that we are replacingnewPath - the path of the wal we are going to createIOExceptionpublic void postWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException
WALObserverpostWALRoll in interface WALObserveroldPath - the path of the wal that we replacednewPath - the path of the wal we have created and now is the currentIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.