Class StandaloneCheckpointIDCounter
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.StandaloneCheckpointIDCounter
-
- All Implemented Interfaces:
CheckpointIDCounter
public class StandaloneCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounterinstances 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 longget()Atomically gets the current checkpoint ID.longgetAndIncrement()Atomically increments the current checkpoint ID.longgetLast()Returns the last checkpoint ID (current - 1).voidsetCount(long newCount)Sets the current checkpoint ID.CompletableFuture<Void>shutdown(org.apache.flink.api.common.JobStatus jobStatus)Shuts theCheckpointIDCounterservice.voidstart()Starts theCheckpointIDCounterservice down.
-
-
-
Method Detail
-
start
public void start() throws ExceptionDescription copied from interface:CheckpointIDCounterStarts theCheckpointIDCounterservice down.- Specified by:
startin interfaceCheckpointIDCounter- Throws:
Exception
-
shutdown
public CompletableFuture<Void> shutdown(org.apache.flink.api.common.JobStatus jobStatus)
Description copied from interface:CheckpointIDCounterShuts theCheckpointIDCounterservice.The job status is forwarded and used to decide whether state should actually be discarded or kept.
- Specified by:
shutdownin interfaceCheckpointIDCounter- Parameters:
jobStatus- Job state on shut down- Returns:
- The
CompletableFutureholding the result of the shutdown operation.
-
getAndIncrement
public long getAndIncrement() throws ExceptionDescription copied from interface:CheckpointIDCounterAtomically increments the current checkpoint ID.- Specified by:
getAndIncrementin interfaceCheckpointIDCounter- Returns:
- The previous checkpoint ID
- Throws:
Exception
-
get
public long get()
Description copied from interface:CheckpointIDCounterAtomically gets the current checkpoint ID.- Specified by:
getin interfaceCheckpointIDCounter- Returns:
- The current checkpoint ID
-
setCount
public void setCount(long newCount)
Description copied from interface:CheckpointIDCounterSets the current checkpoint ID.- Specified by:
setCountin interfaceCheckpointIDCounter- Parameters:
newCount- The new ID
-
getLast
public long getLast()
Returns the last checkpoint ID (current - 1).- Returns:
- Last checkpoint ID.
-
-