Class DurableBackgroundTaskState<R>
- java.lang.Object
-
- org.apache.ignite.internal.processors.localtask.DurableBackgroundTaskState<R>
-
public class DurableBackgroundTaskState<R> extends Object
Class for storing the current state of a durable background task. Task execution state transitions: INIT -> PREPARE -> STARTED -> COMPLETED If the task needs to be restarted, it must have status INIT.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDurableBackgroundTaskState.StateEnumeration of the current state of the task.
-
Constructor Summary
Constructors Constructor Description DurableBackgroundTaskState(DurableBackgroundTask<R> task, GridFutureAdapter<R> outFut, boolean saved, boolean converted)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconverted()Check if the task has been converted from another.GridFutureAdapter<R>outFuture()Getting outside task future.booleansaved()Check if the task has been saved to the MetaStorage.DurableBackgroundTaskState.Statestate()Getting current state of the task.voidstate(DurableBackgroundTaskState.State s)Set the current state of the task.booleanstate(DurableBackgroundTaskState.State exp, DurableBackgroundTaskState.State newState)Atomically sets of the current task state.DurableBackgroundTask<R>task()Getting durable background task.StringtoString()
-
-
-
Constructor Detail
-
DurableBackgroundTaskState
public DurableBackgroundTaskState(DurableBackgroundTask<R> task, GridFutureAdapter<R> outFut, boolean saved, boolean converted)
Constructor.- Parameters:
task- Durable background task.outFut- Outside task future.saved- Task has been saved to the MetaStorage.
-
-
Method Detail
-
task
public DurableBackgroundTask<R> task()
Getting durable background task.- Returns:
- Durable background task.
-
outFuture
public GridFutureAdapter<R> outFuture()
Getting outside task future.- Returns:
- Outside task future.
-
saved
public boolean saved()
Check if the task has been saved to the MetaStorage.- Returns:
Trueif stored in the MetaStorage.
-
state
public DurableBackgroundTaskState.State state()
Getting current state of the task.- Returns:
- Current state of the task.
-
state
public void state(DurableBackgroundTaskState.State s)
Set the current state of the task.- Parameters:
s- New current state of the task.
-
state
public boolean state(DurableBackgroundTaskState.State exp, DurableBackgroundTaskState.State newState)
Atomically sets of the current task state.- Parameters:
exp- Expected state.newState- New state.- Returns:
Trueif successful.
-
converted
public boolean converted()
Check if the task has been converted from another.- Returns:
Trueif it was converted from another task.
-
-