public class KafkaIndexTask extends AbstractTask implements ChatHandler
Modifier and Type | Class and Description |
---|---|
static class |
KafkaIndexTask.Status |
Modifier and Type | Field and Description |
---|---|
static long |
PAUSE_FOREVER |
Constructor and Description |
---|
KafkaIndexTask(String id,
TaskResource taskResource,
DataSchema dataSchema,
KafkaTuningConfig tuningConfig,
KafkaIOConfig ioConfig,
Map<String,Object> context,
ChatHandlerProvider chatHandlerProvider) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRestore()
Returns whether or not this task can restore its progress from its on-disk working directory.
|
Map<Integer,Long> |
getCurrentOffsets() |
DataSchema |
getDataSchema() |
Map<Integer,Long> |
getEndOffsets() |
KafkaIOConfig |
getIOConfig() |
<T> QueryRunner<T> |
getQueryRunner(Query<T> query)
Returns query runners for this task.
|
org.joda.time.DateTime |
getStartTime() |
KafkaIndexTask.Status |
getStatus() |
KafkaTuningConfig |
getTuningConfig() |
String |
getType()
Returns a descriptive label for this task type.
|
boolean |
isReady(TaskActionClient taskActionClient)
Execute preflight actions for a task.
|
javax.ws.rs.core.Response |
pause(long timeout)
Signals the ingestion loop to pause.
|
void |
resume() |
TaskStatus |
run(TaskToolbox toolbox)
Execute a task.
|
javax.ws.rs.core.Response |
setEndOffsets(Map<Integer,Long> offsets,
boolean resume) |
void |
stopGracefully()
Asks a task to arrange for its "run" method to exit promptly.
|
equals, getClasspathPrefix, getContext, getContextValue, getDataSource, getGroupId, getId, getNodeType, getTaskLocks, getTaskResource, hashCode, joinId, makeId, success, toString
public static final long PAUSE_FOREVER
public KafkaIndexTask(String id, TaskResource taskResource, DataSchema dataSchema, KafkaTuningConfig tuningConfig, KafkaIOConfig ioConfig, Map<String,Object> context, ChatHandlerProvider chatHandlerProvider)
public String getType()
Task
public boolean isReady(TaskActionClient taskActionClient) throws Exception
Task
public DataSchema getDataSchema()
public KafkaTuningConfig getTuningConfig()
public KafkaIOConfig getIOConfig()
public TaskStatus run(TaskToolbox toolbox) throws Exception
Task
public 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 <T> QueryRunner<T> getQueryRunner(Query<T> query)
Task
getQueryRunner
in interface Task
getQueryRunner
in class AbstractTask
T
- query result typepublic KafkaIndexTask.Status getStatus()
public javax.ws.rs.core.Response setEndOffsets(Map<Integer,Long> offsets, boolean resume) throws InterruptedException
InterruptedException
public javax.ws.rs.core.Response pause(long timeout) throws InterruptedException
timeout
- how long to pause for before resuming in milliseconds, <= 0 means indefinitelyInterruptedException
public void resume() throws InterruptedException
InterruptedException
public org.joda.time.DateTime getStartTime()
Copyright © 2011–2017. All rights reserved.