T - the type of scriptpublic interface ExecutionScriptHandler<T extends ExecutionScript> extends Service
ExecutionScript handler.
An implementation of this will be handles ExecutionScript,
and then execute some commands on the suitable environment.
Clients must not implement this interface directly,
extend ExecutionScriptHandlerBase and
implement HadoopScriptHandler or CommandScriptHandler instead.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_RESOURCE_ID
The default value of
resource ID. |
static String |
ENV_EXTENSION_PREFIX
The prefix of environment variable names for each extension
Blobs. |
static String |
KEY_ENV_PREFIX
The configuration key prefix of
environment variables. |
static String |
KEY_PROP_PREFIX
The configuration key prefix of
system or hadoop properties. |
static String |
KEY_RESOURCE
The configuration key name of
resource ID. |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp(ExecutionMonitor monitor,
ExecutionContext context)
Cleanup the target environment.
|
void |
execute(ExecutionMonitor monitor,
ExecutionContext context,
T script)
Executes the specified script.
|
Map<String,String> |
getEnvironmentVariables(ExecutionContext context,
ExecutionScript script)
Returns desired environment variables to execute scripts using this handler.
|
String |
getHandlerId()
Returns the ID of this handler.
|
Map<String,String> |
getProperties(ExecutionContext context,
ExecutionScript script)
Returns desired system/hadoop properties to execute scripts using this handler.
|
String |
getResourceId(ExecutionContext context,
ExecutionScript script)
Returns the ID of a resource which is used for executing this handler.
|
void |
setUp(ExecutionMonitor monitor,
ExecutionContext context)
Setup the target environment.
|
static final String KEY_ENV_PREFIX
environment variables.
This value can includes local environment variables in form of ${VARIABLE-NAME}.static final String KEY_PROP_PREFIX
system or hadoop properties.
This value can includes local environment variables in form of ${VARIABLE-NAME}.static final String KEY_RESOURCE
resource ID.static final String DEFAULT_RESOURCE_ID
resource ID.static final String ENV_EXTENSION_PREFIX
Blobs.String getHandlerId()
String getResourceId(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentMap<String,String> getProperties(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentMap<String,String> getEnvironmentVariables(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentvoid setUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
monitor - the progress monitor of the operationcontext - the current execution contextInterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentvoid execute(ExecutionMonitor monitor, ExecutionContext context, T script) throws InterruptedException, IOException
monitor - the progress monitor of the executioncontext - current execution contextscript - target scriptInterruptedException - if the execution was interruptedIOException - if execution was failedvoid cleanUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
monitor - the progress monitor of the operationcontext - the current execution contextInterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.