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,
AuthorizerMapper authorizerMapper) |
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,Map<Integer,Long>> |
getCheckpoints() |
Map<Integer,Map<Integer,Long>> |
getCheckpointsHTTP(javax.servlet.http.HttpServletRequest req) |
Map<Integer,Long> |
getCurrentOffsets() |
Map<Integer,Long> |
getCurrentOffsets(javax.servlet.http.HttpServletRequest req) |
DataSchema |
getDataSchema() |
Map<Integer,Long> |
getEndOffsets() |
Map<Integer,Long> |
getEndOffsetsHTTP(javax.servlet.http.HttpServletRequest req) |
KafkaIOConfig |
getIOConfig() |
int |
getPriority()
Returns task priority.
|
<T> QueryRunner<T> |
getQueryRunner(Query<T> query)
Returns query runners for this task.
|
org.joda.time.DateTime |
getStartTime(javax.servlet.http.HttpServletRequest req) |
KafkaIndexTask.Status |
getStatus() |
KafkaIndexTask.Status |
getStatusHTTP(javax.servlet.http.HttpServletRequest req) |
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) |
javax.ws.rs.core.Response |
pauseHTTP(long timeout,
javax.servlet.http.HttpServletRequest req)
Signals the ingestion loop to pause.
|
void |
resume() |
javax.ws.rs.core.Response |
resumeHTTP(javax.servlet.http.HttpServletRequest req) |
TaskStatus |
run(TaskToolbox toolbox)
Execute a task.
|
javax.ws.rs.core.Response |
setEndOffsets(Map<Integer,Long> offsets,
boolean resume,
boolean finish) |
javax.ws.rs.core.Response |
setEndOffsetsHTTP(Map<Integer,Long> offsets,
boolean resume,
boolean finish,
javax.servlet.http.HttpServletRequest req) |
javax.ws.rs.core.Response |
stop(javax.servlet.http.HttpServletRequest req) |
void |
stopGracefully()
Asks a task to arrange for its "run" method to exit promptly.
|
equals, getClasspathPrefix, getContext, getDataSource, getGroupId, getId, getNodeType, getTaskResource, hashCode, success, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContextValue, getContextValue
public static final long PAUSE_FOREVER
public KafkaIndexTask(String id, TaskResource taskResource, DataSchema dataSchema, KafkaTuningConfig tuningConfig, KafkaIOConfig ioConfig, Map<String,Object> context, ChatHandlerProvider chatHandlerProvider, AuthorizerMapper authorizerMapper)
public int getPriority()
Task
getPriority
in interface Task
for default task priorities
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 javax.ws.rs.core.Response stop(@Context javax.servlet.http.HttpServletRequest req)
public KafkaIndexTask.Status getStatusHTTP(@Context javax.servlet.http.HttpServletRequest req)
public KafkaIndexTask.Status getStatus()
public Map<Integer,Long> getCurrentOffsets(@Context javax.servlet.http.HttpServletRequest req)
public Map<Integer,Long> getEndOffsetsHTTP(@Context javax.servlet.http.HttpServletRequest req)
public javax.ws.rs.core.Response setEndOffsetsHTTP(Map<Integer,Long> offsets, boolean resume, boolean finish, @Context javax.servlet.http.HttpServletRequest req) throws InterruptedException
InterruptedException
public javax.ws.rs.core.Response setEndOffsets(Map<Integer,Long> offsets, boolean resume, boolean finish) throws InterruptedException
InterruptedException
public Map<Integer,Map<Integer,Long>> getCheckpointsHTTP(@Context javax.servlet.http.HttpServletRequest req)
public javax.ws.rs.core.Response pauseHTTP(long timeout, @Context javax.servlet.http.HttpServletRequest req) throws InterruptedException
timeout
- how long to pause for before resuming in milliseconds, <= 0 means indefinitelyInterruptedException
public javax.ws.rs.core.Response pause(long timeout) throws InterruptedException
InterruptedException
public javax.ws.rs.core.Response resumeHTTP(@Context javax.servlet.http.HttpServletRequest req) throws InterruptedException
InterruptedException
public void resume() throws InterruptedException
InterruptedException
public org.joda.time.DateTime getStartTime(@Context javax.servlet.http.HttpServletRequest req)
Copyright © 2011–2018. All rights reserved.