Class WALCoprocessorHost
java.lang.Object
org.apache.hadoop.hbase.coprocessor.CoprocessorHost<WALCoprocessor,WALCoprocessorEnvironment>
org.apache.hadoop.hbase.regionserver.wal.WALCoprocessorHost
@Private
public class WALCoprocessorHost
extends CoprocessorHost<WALCoprocessor,WALCoprocessorEnvironment>
Implements the coprocessor environment and runtime support for coprocessors loaded within a
WAL
.-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Encapsulation of the environment of each coprocessor(package private) class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.coprocessor.CoprocessorHost
CoprocessorHost.ObserverGetter<C,
O>, CoprocessorHost.ObserverOperationWithoutResult<O>, CoprocessorHost.ObserverOperationWithResult<O, R> -
Field Summary
Fields inherited from class org.apache.hadoop.hbase.coprocessor.CoprocessorHost
ABORT_ON_ERROR_KEY, abortable, conf, coprocEnvironments, COPROCESSORS_ENABLED_CONF_KEY, DEFAULT_ABORT_ON_ERROR, DEFAULT_COPROCESSORS_ENABLED, DEFAULT_SKIP_LOAD_DUPLICATE_TABLE_COPROCESSOR, DEFAULT_USER_COPROCESSORS_ENABLED, loadSequence, MASTER_COPROCESSOR_CONF_KEY, pathPrefix, REGION_COPROCESSOR_CONF_KEY, REGIONSERVER_COPROCESSOR_CONF_KEY, SKIP_LOAD_DUPLICATE_TABLE_COPROCESSOR, USER_COPROCESSORS_ENABLED_CONF_KEY, USER_REGION_COPROCESSOR_CONF_KEY, WAL_COPROCESSOR_CONF_KEY
-
Constructor Summary
ConstructorDescriptionWALCoprocessorHost
(WAL log, org.apache.hadoop.conf.Configuration conf) Constructor -
Method Summary
Modifier and TypeMethodDescriptioncheckAndGetInstance
(Class<?> implClass) Called when a new Coprocessor class needs to be loaded.createEnvironment
(WALCoprocessor instance, int priority, int seq, org.apache.hadoop.conf.Configuration conf) Called when a new Coprocessor class is loadedvoid
postWALRoll
(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) Called after rolling the current WALvoid
postWALWrite
(RegionInfo info, WALKey logKey, WALEdit logEdit) void
preWALRoll
(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) Called before rolling the current WALvoid
preWALWrite
(RegionInfo info, WALKey logKey, WALEdit logEdit) Methods inherited from class org.apache.hadoop.hbase.coprocessor.CoprocessorHost
abortServer, abortServer, checkAndLoadInstance, execOperation, execOperationWithResult, execShutdown, findCoprocessor, findCoprocessor, findCoprocessorEnvironment, findCoprocessors, getCoprocessors, getLoadedCoprocessors, handleCoprocessorThrowable, load, load, load, loadSystemCoprocessors, shutdown
-
Field Details
-
LOG
-
wal
-
walObserverGetter
-
-
Constructor Details
-
WALCoprocessorHost
Constructor- Parameters:
log
- the write ahead logconf
- the configuration
-
-
Method Details
-
createEnvironment
public WALCoprocessorHost.WALEnvironment createEnvironment(WALCoprocessor instance, int priority, int seq, org.apache.hadoop.conf.Configuration conf) Description copied from class:CoprocessorHost
Called when a new Coprocessor class is loaded- Specified by:
createEnvironment
in classCoprocessorHost<WALCoprocessor,
WALCoprocessorEnvironment>
-
checkAndGetInstance
public WALCoprocessor checkAndGetInstance(Class<?> implClass) throws IllegalAccessException, InstantiationException Description copied from class:CoprocessorHost
Called when a new Coprocessor class needs to be loaded. Checks if type of the given class is what the corresponding host implementation expects. If it is of correct type, returns an instance of the coprocessor to be loaded. If not, returns null. If an exception occurs when trying to create instance of a coprocessor, it's passed up and eventually results into server aborting.- Specified by:
checkAndGetInstance
in classCoprocessorHost<WALCoprocessor,
WALCoprocessorEnvironment> - Throws:
IllegalAccessException
InstantiationException
-
preWALWrite
- Throws:
IOException
-
postWALWrite
- Throws:
IOException
-
preWALRoll
public void preWALRoll(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException Called before rolling the current WAL- Parameters:
oldPath
- the path of the current wal that we are replacingnewPath
- the path of the wal we are going to create- Throws:
IOException
-
postWALRoll
public void postWALRoll(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException Called after rolling the current WAL- Parameters:
oldPath
- the path of the wal that we replacednewPath
- the path of the wal we have created and now is the current- Throws:
IOException
-