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, toStringpublic 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()
Taskpublic boolean isReady(TaskActionClient taskActionClient) throws Exception
Taskpublic DataSchema getDataSchema()
public KafkaTuningConfig getTuningConfig()
public KafkaIOConfig getIOConfig()
public TaskStatus run(TaskToolbox toolbox) throws Exception
Taskpublic boolean canRestore()
TaskcanRestore in interface TaskcanRestore in class AbstractTaskpublic void stopGracefully()
TaskTask.canRestore() returns true. Tasks that take too long to stop gracefully will be terminated with
extreme prejudice.stopGracefully in interface TaskstopGracefully in class AbstractTaskpublic <T> QueryRunner<T> getQueryRunner(Query<T> query)
TaskgetQueryRunner in interface TaskgetQueryRunner in class AbstractTaskT - query result typepublic KafkaIndexTask.Status getStatus()
public javax.ws.rs.core.Response setEndOffsets(Map<Integer,Long> offsets, boolean resume) throws InterruptedException
InterruptedExceptionpublic javax.ws.rs.core.Response pause(long timeout)
throws InterruptedException
timeout - how long to pause for before resuming in milliseconds, <= 0 means indefinitelyInterruptedExceptionpublic void resume()
throws InterruptedException
InterruptedExceptionpublic org.joda.time.DateTime getStartTime()
Copyright © 2011–2017. All rights reserved.