Interface TaskIndex
- All Known Implementing Classes:
UnixFSTaskIndex
public interface TaskIndex
Indexes all of the
TransactionalTask
instances in the datastore.-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyChange
(ResourceId resourceId, String transactionId) Applies task changes with the suppliedResourceId
and transaction id.void
cleanup
(ResourceId resourceId, String transactionId) Cleans up the task changes with the suppliedResourceId
and transaction id.findTaskEntry
(Supplier<TaskEntry.OperationalStrategy<ResourceId>> ctor, ResourceId resourceId) Finds theTaskEntry<ResourceId>
for the suppliedResourceId
.getOrCreateTaskEntry
(Supplier<TaskEntry.OperationalStrategy<ResourceId>> ctor, ResourceId resourceId) Gets theTaskEntry<ResourceId>
for the suppliedResourceId
.Gets all entries in theTaskIndex
.default Stream
<TransactionalTask> lists all tasks in theTransactionalTask
.
-
Method Details
-
listAllTasks
lists all tasks in theTransactionalTask
. The returnedStream
should be closed when it is finished as it may consume IO resources.- Returns:
- a listing of
TransactionalTask
-
listAllEntriesByResource
Stream<Function<TaskEntry.OperationalStrategy<ResourceId>,TaskEntry<ResourceId>>> listAllEntriesByResource()Gets all entries in theTaskIndex
.- Returns:
- all entries
-
findTaskEntry
Optional<TaskEntry<ResourceId>> findTaskEntry(Supplier<TaskEntry.OperationalStrategy<ResourceId>> ctor, ResourceId resourceId) Finds theTaskEntry<ResourceId>
for the suppliedResourceId
.- Parameters:
ctor
- the constructor fo the operational strategyresourceId
- theResourceId
- Returns:
- the
TaskEntry<ResourceId>
-
getOrCreateTaskEntry
TaskEntry<ResourceId> getOrCreateTaskEntry(Supplier<TaskEntry.OperationalStrategy<ResourceId>> ctor, ResourceId resourceId) Gets theTaskEntry<ResourceId>
for the suppliedResourceId
.- Parameters:
ctor
- the constructor fo the operational strategyresourceId
- theResourceId
- Returns:
- the
TaskEntry<ResourceId>
-
cleanup
Cleans up the task changes with the suppliedResourceId
and transaction id.- Parameters:
resourceId
-transactionId
-
-
applyChange
Applies task changes with the suppliedResourceId
and transaction id.- Parameters:
resourceId
-transactionId
-
-