E
- the specific environment extension that a concrete implementation
provides@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public abstract class CoprocessorHost<E extends CoprocessorEnvironment> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CoprocessorHost.Environment
Encapsulation of the environment of each coprocessor
|
Modifier and Type | Field and Description |
---|---|
static String |
ABORT_ON_ERROR_KEY |
protected Abortable |
abortable |
protected org.apache.hadoop.conf.Configuration |
conf |
protected SortedSet<E> |
coprocessors
Ordered set of loaded coprocessors with lock
|
static boolean |
DEFAULT_ABORT_ON_ERROR |
protected AtomicInteger |
loadSequence |
static String |
MASTER_COPROCESSOR_CONF_KEY |
protected String |
pathPrefix |
static String |
REGION_COPROCESSOR_CONF_KEY |
static String |
REGIONSERVER_COPROCESSOR_CONF_KEY |
static String |
USER_REGION_COPROCESSOR_CONF_KEY |
static String |
WAL_COPROCESSOR_CONF_KEY |
Constructor and Description |
---|
CoprocessorHost(Abortable abortable) |
Modifier and Type | Method and Description |
---|---|
protected void |
abortServer(CoprocessorEnvironment environment,
Throwable e) |
protected void |
abortServer(String coprocessorName,
Throwable e) |
abstract E |
createEnvironment(Class<?> implClass,
Coprocessor instance,
int priority,
int sequence,
org.apache.hadoop.conf.Configuration conf)
Called when a new Coprocessor class is loaded
|
Coprocessor |
findCoprocessor(String className)
Find a coprocessor implementation by class name
|
CoprocessorEnvironment |
findCoprocessorEnvironment(String className)
Find a coprocessor environment by class name
|
Set<String> |
getCoprocessors()
Used to create a parameter to the HServerLoad constructor so that
HServerLoad can provide information about the coprocessors loaded by this
regionserver.
|
static Set<String> |
getLoadedCoprocessors() |
protected void |
handleCoprocessorThrowable(CoprocessorEnvironment env,
Throwable e)
This is used by coprocessor hooks which are declared to throw IOException
(or its subtypes).
|
void |
load(Class<?> implClass,
int priority,
org.apache.hadoop.conf.Configuration conf) |
E |
load(org.apache.hadoop.fs.Path path,
String className,
int priority,
org.apache.hadoop.conf.Configuration conf)
Load a coprocessor implementation into the host
|
E |
loadInstance(Class<?> implClass,
int priority,
org.apache.hadoop.conf.Configuration conf) |
protected void |
loadSystemCoprocessors(org.apache.hadoop.conf.Configuration conf,
String confKey)
Load system coprocessors.
|
void |
shutdown(CoprocessorEnvironment e) |
public static final String REGION_COPROCESSOR_CONF_KEY
public static final String REGIONSERVER_COPROCESSOR_CONF_KEY
public static final String USER_REGION_COPROCESSOR_CONF_KEY
public static final String MASTER_COPROCESSOR_CONF_KEY
public static final String WAL_COPROCESSOR_CONF_KEY
public static final String ABORT_ON_ERROR_KEY
public static final boolean DEFAULT_ABORT_ON_ERROR
protected Abortable abortable
protected SortedSet<E extends CoprocessorEnvironment> coprocessors
protected org.apache.hadoop.conf.Configuration conf
protected String pathPrefix
protected AtomicInteger loadSequence
public CoprocessorHost(Abortable abortable)
public Set<String> getCoprocessors()
protected void loadSystemCoprocessors(org.apache.hadoop.conf.Configuration conf, String confKey)
public E load(org.apache.hadoop.fs.Path path, String className, int priority, org.apache.hadoop.conf.Configuration conf) throws IOException
path
- path to implementation jarclassName
- the main class namepriority
- chaining priorityconf
- configuration for coprocessorIOException
- Exceptionpublic void load(Class<?> implClass, int priority, org.apache.hadoop.conf.Configuration conf) throws IOException
implClass
- Implementation classpriority
- priorityconf
- configurationIOException
- Exceptionpublic E loadInstance(Class<?> implClass, int priority, org.apache.hadoop.conf.Configuration conf) throws IOException
implClass
- Implementation classpriority
- priorityconf
- configurationIOException
- Exceptionpublic abstract E createEnvironment(Class<?> implClass, Coprocessor instance, int priority, int sequence, org.apache.hadoop.conf.Configuration conf)
public void shutdown(CoprocessorEnvironment e)
public Coprocessor findCoprocessor(String className)
className
- the class namepublic CoprocessorEnvironment findCoprocessorEnvironment(String className)
className
- the class nameprotected void abortServer(CoprocessorEnvironment environment, Throwable e)
protected void handleCoprocessorThrowable(CoprocessorEnvironment env, Throwable e) throws IOException
env
- Coprocessor Environmente
- Throwable object thrown by coprocessor.IOException
- ExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.