public class UpdatingInstanceCountTask extends Object implements BackgroundTask
Task that controls when types are updated with their new instance counts
This task begins only if enough time has passed (configurable) since the last time a job was added.
| Modifier and Type | Field and Description |
|---|---|
static GraknEngineConfig |
CONFIG |
static RedisConnection |
redis |
| Constructor and Description |
|---|
UpdatingInstanceCountTask() |
| Modifier and Type | Method and Description |
|---|---|
static TaskConfiguration |
createConfig(String keyspace,
String config)
Helper method which creates the task config needed in order to execute the updating count task
|
static TaskState |
createTask(Class creator)
Helper method which creates PP Task States.
|
void |
pause()
Called to suspend the execution of a currently running task.
|
boolean |
resume(java.util.function.Consumer<TaskCheckpoint> saveCheckpoint,
TaskCheckpoint lastCheckpoint)
This method may be called when resuming from a paused state or recovering from a crash or failure of any kind.
|
boolean |
start(java.util.function.Consumer<TaskCheckpoint> saveCheckpoint,
TaskConfiguration configuration,
TaskSubmitter taskSubmitter)
Called to start execution of the task, may be called on a newly scheduled or previously stopped task.
|
boolean |
stop()
Called to stop execution of the task, may be called on a running or paused task.
|
public static final RedisConnection redis
public static final GraknEngineConfig CONFIG
public boolean start(java.util.function.Consumer<TaskCheckpoint> saveCheckpoint, TaskConfiguration configuration, TaskSubmitter taskSubmitter)
BackgroundTaskstart in interface BackgroundTasksaveCheckpoint - Consumerconfiguration - The configuration needed to execute the tasktaskSubmitter - Allows followup tasks to be submitted for processingpublic boolean stop()
BackgroundTaskstop in interface BackgroundTaskpublic void pause()
BackgroundTaskpause in interface BackgroundTaskpublic boolean resume(java.util.function.Consumer<TaskCheckpoint> saveCheckpoint, TaskCheckpoint lastCheckpoint)
BackgroundTaskresume in interface BackgroundTasksaveCheckpoint - ConsumerlastCheckpoint - The last checkpoint as sent to saveCheckpoint.public static TaskState createTask(Class creator)
creator - The class which is creating the taskpublic static TaskConfiguration createConfig(String keyspace, String config)
keyspace - The keyspace of the graph to execute this on.config - The config which contains the concepts with updated countsCopyright © 2017 Grakn Labs Ltd. All rights reserved.