public class StandaloneCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounter
instances for JobManagers running in HighAvailabilityMode.NONE
.
Simple wrapper around an AtomicLong
.
INITIAL_CHECKPOINT_ID
Constructor and Description |
---|
StandaloneCheckpointIDCounter() |
Modifier and Type | Method and 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 the
CheckpointIDCounter service. |
void |
start()
Starts the
CheckpointIDCounter service down. |
public void start() throws Exception
CheckpointIDCounter
CheckpointIDCounter
service down.start
in interface CheckpointIDCounter
Exception
public CompletableFuture<Void> shutdown(JobStatus jobStatus)
CheckpointIDCounter
CheckpointIDCounter
service.
The job status is forwarded and used to decide whether state should actually be discarded or kept.
shutdown
in interface CheckpointIDCounter
jobStatus
- Job state on shut downCompletableFuture
holding the result of the shutdown operation.public long getAndIncrement() throws Exception
CheckpointIDCounter
getAndIncrement
in interface CheckpointIDCounter
Exception
public long get()
CheckpointIDCounter
get
in interface CheckpointIDCounter
public void setCount(long newCount)
CheckpointIDCounter
setCount
in interface CheckpointIDCounter
newCount
- The new IDpublic long getLast()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.