public class SingleQueueTaskManager extends Object implements TaskManager
TaskManager implementation that operates using a single Kafka queue and controls the
lifecycle SingleQueueTaskManager| Constructor and Description |
|---|
SingleQueueTaskManager(EngineID engineId,
GraknEngineConfig config,
RedisConnection redis,
EngineGraknGraphFactory factory)
Create a
SingleQueueTaskManager
The SingleQueueTaskManager implementation must:
+ Instantiate a connection to zookeeper
+ Configure and instance of TaskStateStorage
+ Create and run an instance of SingleQueueTaskRunner
+ Add oneself to the leader elector by instantiating failoverelector |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(TaskState taskState,
TaskConfiguration configuration)
Serialize and send the given task to the given kafka queue
|
void |
close()
Close the
SingleQueueTaskRunner and . |
void |
stopTask(TaskId id)
Stop a task from running.
|
TaskStateStorage |
storage()
Access the storage that this instance of TaskManager uses.
|
public SingleQueueTaskManager(EngineID engineId, GraknEngineConfig config, RedisConnection redis, EngineGraknGraphFactory factory)
SingleQueueTaskManager
The SingleQueueTaskManager implementation must:
+ Instantiate a connection to zookeeper
+ Configure and instance of TaskStateStorage
+ Create and run an instance of SingleQueueTaskRunner
+ Add oneself to the leader elector by instantiating failoverelectorpublic void close()
SingleQueueTaskRunner and . Any errors that occur should not prevent the
subsequent ones from executing.close in interface TaskManagerpublic void stopTask(TaskId id)
stopTask in interface TaskManagerid - ID of task to stop.public TaskStateStorage storage()
storage in interface TaskManagerpublic void addTask(TaskState taskState, TaskConfiguration configuration)
addTask in interface TaskSubmittertaskState - Task to send to kafkaconfiguration - Configuration of the given taskCopyright © 2017 Grakn Labs Ltd. All rights reserved.