public class StandaloneTaskManager extends Object implements TaskManager
In-memory task manager to schedule and execute tasks. By default this task manager uses an in-memory state storage.
If engine fails while using this task manager, there will be no possibility for task recovery.
| Constructor and Description |
|---|
StandaloneTaskManager(EngineID engineId,
GraknEngineConfig config,
RedisCountStorage redis,
EngineGraknGraphFactory factory,
LockProvider lockProvider,
com.codahale.metrics.MetricRegistry metricRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(TaskState taskState,
TaskConfiguration configuration)
Schedule a
BackgroundTask for execution. |
void |
close() |
CompletableFuture<Void> |
start()
Make sure the manager is initialized and starts processing tasks
|
void |
stopTask(TaskId id)
Stop a Scheduled, Paused or Running task.
|
TaskStateStorage |
storage()
Return the StateStorage instance that is used by this class.
|
public StandaloneTaskManager(EngineID engineId, GraknEngineConfig config, RedisCountStorage redis, EngineGraknGraphFactory factory, LockProvider lockProvider, com.codahale.metrics.MetricRegistry metricRegistry)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic void addTask(TaskState taskState, TaskConfiguration configuration)
TaskSubmitterBackgroundTask for execution.addTask in interface TaskSubmittertaskState - Task to executepublic CompletableFuture<Void> start()
TaskManagerstart in interface TaskManagerpublic void stopTask(TaskId id)
TaskManagerstopTask in interface TaskManagerid - ID of task to stop.public TaskStateStorage storage()
TaskManagerstorage in interface TaskManagerCopyright © 2017 Grakn Labs Ltd. All rights reserved.