@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public interface WALObserver extends Coprocessor
WALEdit.isEmpty().
RegionObserver provides
hooks for adding logic for WALEdits in the region context during reconstruction.
Defines coprocessor hooks for interacting with operations on the
WAL.
Since most implementations will be interested in only a subset of hooks, this class uses
'default' functions to avoid having to add unnecessary overrides. When the functions are
non-empty, it's simply to satisfy the compiler by returning value of expected (non-void) type.
It is done in a way that these default definitions act as no-op. So our suggestion to
implementation would be to not call these 'default' methods from overrides.
IOException are reported back to client.CoprocessorHost.ABORT_ON_ERROR_KEY is set to true, then
the server aborts.DoNotRetryIOException is returned to the client.Coprocessor.StatePRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Modifier and Type | Method and Description |
|---|---|
default void |
postWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
Called after rolling the current WAL
|
default void |
postWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
HRegionInfo info,
WALKey logKey,
WALEdit logEdit)
Called after a
WALEdit
is writen to WAL. |
default void |
preWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath)
Called before rolling the current WAL
|
default boolean |
preWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx,
HRegionInfo info,
WALKey logKey,
WALEdit logEdit)
Called before a
WALEdit
is writen to WAL. |
start, stopdefault boolean preWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx, HRegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException
WALEdit
is writen to WAL.IOExceptiondefault void postWALWrite(ObserverContext<? extends WALCoprocessorEnvironment> ctx, HRegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException
WALEdit
is writen to WAL.IOExceptiondefault void preWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException
oldPath - the path of the current wal that we are replacingnewPath - the path of the wal we are going to createIOExceptiondefault void postWALRoll(ObserverContext<? extends WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException
oldPath - the path of the wal that we replacednewPath - the path of the wal we have created and now is the currentIOExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.