public interface Task
Modifier and Type | Method and Description |
---|---|
boolean |
canRestore()
Returns whether or not this task can restore its progress from its on-disk working directory.
|
String |
getClasspathPrefix()
Returns an extra classpath that should be prepended to the default classpath when running this task.
|
Map<String,Object> |
getContext() |
Object |
getContextValue(String key) |
String |
getDataSource()
Returns the datasource this task operates on.
|
String |
getGroupId()
Returns group ID of this task.
|
String |
getId()
Returns ID of this task.
|
String |
getNodeType()
Get the nodeType for if/when this task publishes on zookeeper.
|
<T> QueryRunner<T> |
getQueryRunner(Query<T> query)
Returns query runners for this task.
|
TaskResource |
getTaskResource()
Returns a
TaskResource for this task. |
String |
getType()
Returns a descriptive label for this task type.
|
boolean |
isReady(TaskActionClient taskActionClient)
Execute preflight actions for a task.
|
TaskStatus |
run(TaskToolbox toolbox)
Execute a task.
|
void |
stopGracefully()
Asks a task to arrange for its "run" method to exit promptly.
|
String getId()
String getGroupId()
TaskResource getTaskResource()
TaskResource
for this task. Task resources define specific
worker requirements a task may require.TaskResource
for this taskString getType()
String getNodeType()
String getDataSource()
<T> QueryRunner<T> getQueryRunner(Query<T> query)
T
- query result typeString getClasspathPrefix()
boolean isReady(TaskActionClient taskActionClient) throws Exception
taskActionClient
- action client for this task (not the full toolbox)Exception
- if the task should be considered a failureboolean canRestore()
void stopGracefully()
canRestore()
returns true. Tasks that take too long to stop gracefully will be terminated with
extreme prejudice.TaskStatus run(TaskToolbox toolbox) throws Exception
toolbox
- Toolbox for this taskException
- if this task failedCopyright © 2011–2017. All rights reserved.