public class RealtimeIndexTask extends AbstractTask
Modifier and Type | Class and Description |
---|---|
static class |
RealtimeIndexTask.TaskActionSegmentPublisher |
Constructor and Description |
---|
RealtimeIndexTask(String id,
TaskResource taskResource,
FireDepartment fireDepartment,
Map<String,Object> context) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRestore()
Returns whether or not this task can restore its progress from its on-disk working directory.
|
Firehose |
getFirehose()
Public for tests.
|
FireDepartmentMetrics |
getMetrics()
Public for tests.
|
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.
|
FireDepartment |
getRealtimeIngestionSchema() |
String |
getType()
Returns a descriptive label for this task type.
|
protected boolean |
isFirehoseDrainableByClosing(FirehoseFactory firehoseFactory)
Is a firehose from this factory drainable by closing it? If so, we should drain on stopGracefully rather than
abruptly stopping.
|
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.
|
equals, getClasspathPrefix, getContext, getContextValue, getDataSource, getGroupId, getId, getTaskLocks, getTaskResource, hashCode, joinId, makeId, success, toString
public RealtimeIndexTask(String id, TaskResource taskResource, FireDepartment fireDepartment, Map<String,Object> context)
public String getType()
Task
public String getNodeType()
Task
getNodeType
in interface Task
getNodeType
in class AbstractTask
public <T> QueryRunner<T> getQueryRunner(Query<T> query)
Task
getQueryRunner
in interface Task
getQueryRunner
in class AbstractTask
T
- query result typepublic boolean isReady(TaskActionClient taskActionClient) throws Exception
Task
taskActionClient
- action client for this task (not the full toolbox)Exception
- if the task should be considered a failurepublic TaskStatus run(TaskToolbox toolbox) throws Exception
Task
toolbox
- Toolbox for this taskException
- if this task failedpublic boolean canRestore()
Task
canRestore
in interface Task
canRestore
in class AbstractTask
public void stopGracefully()
Task
Task.canRestore()
returns true. Tasks that take too long to stop gracefully will be terminated with
extreme prejudice.stopGracefully
in interface Task
stopGracefully
in class AbstractTask
public Firehose getFirehose()
public FireDepartmentMetrics getMetrics()
public FireDepartment getRealtimeIngestionSchema()
protected boolean isFirehoseDrainableByClosing(FirehoseFactory firehoseFactory)
Copyright © 2011–2017. All rights reserved.