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()  | 
default <ContextValueType> | 
getContextValue(String key)  | 
default <ContextValueType> | 
getContextValue(String key,
               ContextValueType defaultValue)  | 
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. 
 | 
default int | 
getPriority()
Returns task priority. 
 | 
<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()
default int getPriority()
for default task prioritiesTaskResource 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 faileddefault <ContextValueType> ContextValueType getContextValue(String key, ContextValueType defaultValue)
Copyright © 2011–2018. All rights reserved.