public class KubernetesCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounter
implementation for Kubernetes. The counter will be stored in
JobManager-JobID
-leader ConfigMap. The key is Constants.CHECKPOINT_COUNTER_KEY
, and value is counter value.INITIAL_CHECKPOINT_ID
Constructor and Description |
---|
KubernetesCheckpointIDCounter(FlinkKubeClient kubeClient,
String configMapName,
String lockIdentity) |
Modifier and Type | Method and Description |
---|---|
long |
get()
Atomically gets the current checkpoint ID.
|
long |
getAndIncrement()
Atomically increments the current checkpoint ID.
|
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 KubernetesCheckpointIDCounter(FlinkKubeClient kubeClient, String configMapName, @Nullable String lockIdentity)
public void start()
CheckpointIDCounter
CheckpointIDCounter
service down.start
in interface CheckpointIDCounter
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) throws Exception
CheckpointIDCounter
setCount
in interface CheckpointIDCounter
newCount
- The new IDException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.