public class ZooKeeperCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounter instances for JobManagers running in HighAvailabilityMode.ZOOKEEPER.
Each counter creates a ZNode:
+----O /flink/checkpoint-counter/<job-id> 1 [persistent] . . . +----O /flink/checkpoint-counter/<job-id> N [persistent]
The checkpoints IDs are required to be ascending (per job). In order to guarantee this in case of job manager failures we use ZooKeeper to have a shared counter across job manager instances.
INITIAL_CHECKPOINT_ID| 构造器和说明 |
|---|
ZooKeeperCheckpointIDCounter(org.apache.flink.shaded.curator4.org.apache.curator.framework.CuratorFramework client,
LastStateConnectionStateListener connectionStateListener)
Creates a
ZooKeeperCheckpointIDCounter instance. |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
get()
Atomically gets the current checkpoint ID.
|
long |
getAndIncrement()
Atomically increments the current checkpoint ID.
|
void |
setCount(long newId)
Sets the current checkpoint ID.
|
void |
shutdown(org.apache.flink.api.common.JobStatus jobStatus)
Shuts the
CheckpointIDCounter service. |
void |
start()
Starts the
CheckpointIDCounter service down. |
public ZooKeeperCheckpointIDCounter(org.apache.flink.shaded.curator4.org.apache.curator.framework.CuratorFramework client,
LastStateConnectionStateListener connectionStateListener)
ZooKeeperCheckpointIDCounter instance.client - Curator ZooKeeper clientpublic void start()
throws Exception
CheckpointIDCounterCheckpointIDCounter service down.start 在接口中 CheckpointIDCounterExceptionpublic void shutdown(org.apache.flink.api.common.JobStatus jobStatus)
throws Exception
CheckpointIDCounterCheckpointIDCounter service.
The job status is forwarded and used to decide whether state should actually be discarded or kept.
shutdown 在接口中 CheckpointIDCounterjobStatus - Job state on shut downExceptionpublic long getAndIncrement()
throws Exception
CheckpointIDCountergetAndIncrement 在接口中 CheckpointIDCounterExceptionpublic long get()
CheckpointIDCounterget 在接口中 CheckpointIDCounterpublic void setCount(long newId)
throws Exception
CheckpointIDCountersetCount 在接口中 CheckpointIDCounternewId - The new IDExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.