Class StandaloneCheckpointIDCounter
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.StandaloneCheckpointIDCounter
-
- All Implemented Interfaces:
CheckpointIDCounter
public class StandaloneCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounter
instances for JobManagers running inHighAvailabilityMode.NONE
.Simple wrapper around an
AtomicLong
.
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.checkpoint.CheckpointIDCounter
INITIAL_CHECKPOINT_ID
-
-
Constructor Summary
Constructors Constructor Description StandaloneCheckpointIDCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
get()
Atomically gets the current checkpoint ID.long
getAndIncrement()
Atomically increments the current checkpoint ID.long
getLast()
Returns the last checkpoint ID (current - 1).void
setCount(long newCount)
Sets the current checkpoint ID.CompletableFuture<Void>
shutdown(JobStatus jobStatus)
Shuts theCheckpointIDCounter
service.void
start()
Starts theCheckpointIDCounter
service down.
-
-
-
Method Detail
-
start
public void start() throws Exception
Description copied from interface:CheckpointIDCounter
Starts theCheckpointIDCounter
service down.- Specified by:
start
in interfaceCheckpointIDCounter
- Throws:
Exception
-
shutdown
public CompletableFuture<Void> shutdown(JobStatus jobStatus)
Description copied from interface:CheckpointIDCounter
Shuts theCheckpointIDCounter
service.The job status is forwarded and used to decide whether state should actually be discarded or kept.
- Specified by:
shutdown
in interfaceCheckpointIDCounter
- Parameters:
jobStatus
- Job state on shut down- Returns:
- The
CompletableFuture
holding the result of the shutdown operation.
-
getAndIncrement
public long getAndIncrement() throws Exception
Description copied from interface:CheckpointIDCounter
Atomically increments the current checkpoint ID.- Specified by:
getAndIncrement
in interfaceCheckpointIDCounter
- Returns:
- The previous checkpoint ID
- Throws:
Exception
-
get
public long get()
Description copied from interface:CheckpointIDCounter
Atomically gets the current checkpoint ID.- Specified by:
get
in interfaceCheckpointIDCounter
- Returns:
- The current checkpoint ID
-
setCount
public void setCount(long newCount)
Description copied from interface:CheckpointIDCounter
Sets the current checkpoint ID.- Specified by:
setCount
in interfaceCheckpointIDCounter
- Parameters:
newCount
- The new ID
-
getLast
public long getLast()
Returns the last checkpoint ID (current - 1).- Returns:
- Last checkpoint ID.
-
-