public class RedisTaskStorage extends Object implements TaskStateStorage
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsTask(TaskId id)
Returns whether the storage contains the given task
|
static RedisTaskStorage |
create(ai.grakn.redisq.Redisq<Task> redisq,
com.codahale.metrics.MetricRegistry metricRegistry) |
TaskState |
getState(TaskId id)
This is a copy of the internal TaskState object.
|
Set<TaskState> |
getTasks(TaskStatus taskStatus,
String taskClassName,
String createdBy,
EngineID runningOnEngine,
int limit,
int offset)
Return a Set of Pairs of tasks that match any of the criteria.
|
TaskId |
newState(TaskState state)
Create a new task state and store it, returning an ID to later access this task state.
|
Boolean |
updateState(TaskState state)
Used to update task state.
|
public static RedisTaskStorage create(ai.grakn.redisq.Redisq<Task> redisq, com.codahale.metrics.MetricRegistry metricRegistry)
public TaskId newState(TaskState state) throws ai.grakn.exception.GraknBackendException
TaskStateStoragenewState in interface TaskStateStoragestate - State to insert.ai.grakn.exception.GraknBackendExceptionpublic Boolean updateState(TaskState state)
TaskStateStorageupdateState in interface TaskStateStoragestate - State to update.@Nullable public TaskState getState(TaskId id) throws ai.grakn.exception.GraknBackendException
TaskStateStoragegetState in interface TaskStateStorageid - String id of task.ai.grakn.exception.GraknBackendExceptionpublic boolean containsTask(TaskId id)
TaskStateStoragecontainsTask in interface TaskStateStorageid - String id of taskpublic Set<TaskState> getTasks(@Nullable TaskStatus taskStatus, @Nullable String taskClassName, @Nullable String createdBy, @Nullable EngineID runningOnEngine, int limit, int offset)
TaskStateStoragegetTasks in interface TaskStateStoragetaskStatus - See TaskStatus enum.taskClassName - String containing task class name. See TaskState.createdBy - String containing created by. See TaskState.runningOnEngine - Engine that the task is running on.limit - Limit the returned result set to @limit amount of entries.offset - Use in conjunction with @limit for pagination.public void clear()
clear in interface TaskStateStorageCopyright © 2017 Grakn Labs Ltd. All rights reserved.