public abstract class AbstractTask extends Object implements Task
Modifier | Constructor and Description |
---|---|
protected |
AbstractTask(String id,
String dataSource) |
protected |
AbstractTask(String id,
String groupId,
String dataSource) |
protected |
AbstractTask(String id,
String groupId,
TaskResource taskResource,
String dataSource) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getClasspathPrefix()
Returns an extra classpath that should be prepended to the default classpath when running this task.
|
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.
|
protected Iterable<TaskLock> |
getTaskLocks(TaskToolbox toolbox) |
TaskResource |
getTaskResource()
Returns a
TaskResource for this task. |
int |
hashCode() |
static String |
joinId(Object... objects)
Start helper methods
|
static String |
makeId(String id,
String typeName,
String dataSource,
org.joda.time.Interval interval) |
TaskStatus |
success() |
String |
toString() |
protected AbstractTask(String id, String groupId, TaskResource taskResource, String dataSource)
public static String makeId(String id, String typeName, String dataSource, org.joda.time.Interval interval)
public String getId()
Task
public String getGroupId()
Task
getGroupId
in interface Task
public TaskResource getTaskResource()
Task
TaskResource
for this task. Task resources define specific
worker requirements a task may require.getTaskResource
in interface Task
TaskResource
for this taskpublic String getNodeType()
Task
getNodeType
in interface Task
public String getDataSource()
Task
getDataSource
in interface Task
public <T> QueryRunner<T> getQueryRunner(Query<T> query)
Task
getQueryRunner
in interface Task
T
- query result typepublic String getClasspathPrefix()
Task
getClasspathPrefix
in interface Task
public static String joinId(Object... objects)
objects
- objects to joinpublic TaskStatus success()
protected Iterable<TaskLock> getTaskLocks(TaskToolbox toolbox) throws IOException
IOException
Copyright © 2011–2015. All rights reserved.