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)
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)
Create an instance of a task based on the given parameters and submit it a Kafka queue.
|
void |
close()
Close the
SingleQueueTaskRunner and . |
org.apache.kafka.clients.consumer.Consumer<TaskId,TaskState> |
newConsumer()
Get a new kafka consumer listening on the new tasks topic
|
void |
stopTask(TaskId id)
Stop a task from running.
|
TaskStateStorage |
storage()
Access the storage that this instance of TaskManager uses.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchooseStoragepublic SingleQueueTaskManager(EngineID engineId) throws Exception
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 failoverelectorExceptionpublic void close()
SingleQueueTaskRunner and . Any errors that occur should not prevent the
subsequent ones from executing.close in interface AutoCloseablepublic void addTask(TaskState taskState)
addTask in interface TaskManagertaskState - Task to executepublic void stopTask(TaskId id)
stopTask in interface TaskManagerid - ID of task to stop.public TaskStateStorage storage()
storage in interface TaskManagerCopyright © 2017 Grakn Labs Ltd. All rights reserved.