Class ZooKeeperLeaderElectionHaServices
java.lang.Object
org.apache.flink.runtime.highavailability.AbstractHaServices
org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperLeaderElectionHaServices
- All Implemented Interfaces:
AutoCloseable,GloballyCleanableResource,ClientHighAvailabilityServices,HighAvailabilityServices
ZooKeeper HA services that only use a single leader election per process.
/flink
+/cluster_id_1/leader/latch
| | /resource_manager/connection_info
| | /dispatcher/connection_info
| | /rest_server/connection_info
| | /job-id-1/connection_info
| | /job-id-2/connection_info
| |
| |
| +jobgraphs/job-id-1
| | /job-id-2
| +jobs/job-id-1/checkpoints/latest
| | /latest-1
| | /latest-2
| | /checkpoint_id_counter
-
Field Summary
Fields inherited from class org.apache.flink.runtime.highavailability.AbstractHaServices
configuration, ioExecutor, loggerFields inherited from interface org.apache.flink.runtime.highavailability.HighAvailabilityServices
DEFAULT_JOB_ID, DEFAULT_LEADER_ID -
Constructor Summary
ConstructorsConstructorDescriptionZooKeeperLeaderElectionHaServices(CuratorFrameworkWithUnhandledErrorListener curatorFrameworkWrapper, org.apache.flink.configuration.Configuration configuration, Executor executor, BlobStoreService blobStoreService) -
Method Summary
Modifier and TypeMethodDescriptionCreate the checkpoint recovery factory for the job manager.Create the submitted execution plan store for the job manager.protected LeaderRetrievalServicecreateLeaderRetrievalService(String componentId) Create leader retrieval service with specified leaderName.protected voiddeleteZNode(String path) protected StringGet the leader path for Dispatcher.protected StringgetLeaderPathForJobManager(org.apache.flink.api.common.JobID jobID) Get the leader path for specific JobManager.protected StringGet the leader path for ResourceManager.protected StringGet the leader path for RestServer.protected voidClean up the meta data in the distributed system(e.g.protected voidinternalCleanupJobData(org.apache.flink.api.common.JobID jobID) Clean up the meta data in the distributed system(e.g.protected voidCloses the components which is used for external operations(e.g.Methods inherited from class org.apache.flink.runtime.highavailability.AbstractHaServices
cleanupAllData, close, createBlobStore, getCheckpointRecoveryFactory, getClusterRestEndpointLeaderElection, getClusterRestEndpointLeaderRetriever, getDispatcherLeaderElection, getDispatcherLeaderRetriever, getExecutionPlanStore, getJobManagerLeaderElection, getJobManagerLeaderRetriever, getJobManagerLeaderRetriever, getJobResultStore, getResourceManagerLeaderElection, getResourceManagerLeaderRetriever, globalCleanupAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.highavailability.HighAvailabilityServices
closeWithOptionalClean, getWebMonitorLeaderElection, getWebMonitorLeaderRetriever
-
Constructor Details
-
ZooKeeperLeaderElectionHaServices
public ZooKeeperLeaderElectionHaServices(CuratorFrameworkWithUnhandledErrorListener curatorFrameworkWrapper, org.apache.flink.configuration.Configuration configuration, Executor executor, BlobStoreService blobStoreService) throws Exception - Throws:
Exception
-
-
Method Details
-
createCheckpointRecoveryFactory
Description copied from class:AbstractHaServicesCreate the checkpoint recovery factory for the job manager.- Specified by:
createCheckpointRecoveryFactoryin classAbstractHaServices- Returns:
- Checkpoint recovery factory
- Throws:
Exception
-
createExecutionPlanStore
Description copied from class:AbstractHaServicesCreate the submitted execution plan store for the job manager.- Specified by:
createExecutionPlanStorein classAbstractHaServices- Returns:
- Submitted execution plan store
- Throws:
Exception- if the submitted execution plan store could not be created
-
internalClose
protected void internalClose()Description copied from class:AbstractHaServicesCloses the components which is used for external operations(e.g. Zookeeper Client, Kubernetes Client).- Specified by:
internalClosein classAbstractHaServices
-
internalCleanup
Description copied from class:AbstractHaServicesClean up the meta data in the distributed system(e.g. Zookeeper, Kubernetes ConfigMap).If an exception occurs during internal cleanup, we will continue the cleanup in
AbstractHaServices.cleanupAllData()and report exceptions only after all cleanup steps have been attempted.- Specified by:
internalCleanupin classAbstractHaServices- Throws:
Exception- when do the cleanup operation on external storage.
-
internalCleanupJobData
Description copied from class:AbstractHaServicesClean up the meta data in the distributed system(e.g. Zookeeper, Kubernetes ConfigMap) for the specified Job. Method implementations need to be thread-safe.- Specified by:
internalCleanupJobDatain classAbstractHaServices- Parameters:
jobID- The identifier of the job to cleanup.- Throws:
Exception- when do the cleanup operation on external storage.
-
deleteZNode
- Throws:
Exception
-
createLeaderRetrievalService
Description copied from class:AbstractHaServicesCreate leader retrieval service with specified leaderName.- Specified by:
createLeaderRetrievalServicein classAbstractHaServices- Parameters:
componentId- ConfigMap name in Kubernetes or child node path in Zookeeper.- Returns:
- Return LeaderRetrievalService using Zookeeper or Kubernetes.
-
getLeaderPathForResourceManager
Description copied from class:AbstractHaServicesGet the leader path for ResourceManager.- Specified by:
getLeaderPathForResourceManagerin classAbstractHaServices- Returns:
- Return the ResourceManager leader name. It is ConfigMap name in Kubernetes or child node path in Zookeeper.
-
getLeaderPathForDispatcher
Description copied from class:AbstractHaServicesGet the leader path for Dispatcher.- Specified by:
getLeaderPathForDispatcherin classAbstractHaServices- Returns:
- Return the Dispatcher leader name. It is ConfigMap name in Kubernetes or child node path in Zookeeper.
-
getLeaderPathForJobManager
Description copied from class:AbstractHaServicesGet the leader path for specific JobManager.- Specified by:
getLeaderPathForJobManagerin classAbstractHaServices- Parameters:
jobID- job id- Returns:
- Return the JobManager leader name for specified job id. It is ConfigMap name in Kubernetes or child node path in Zookeeper.
-
getLeaderPathForRestServer
Description copied from class:AbstractHaServicesGet the leader path for RestServer.- Specified by:
getLeaderPathForRestServerin classAbstractHaServices- Returns:
- Return the RestServer leader name. It is ConfigMap name in Kubernetes or child node path in Zookeeper.
-