Class EmbeddedHaServices
- java.lang.Object
-
- org.apache.flink.runtime.highavailability.nonha.AbstractNonHaServices
-
- org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedHaServices
-
- All Implemented Interfaces:
AutoCloseable,GloballyCleanableResource,ClientHighAvailabilityServices,HighAvailabilityServices
- Direct Known Subclasses:
EmbeddedHaServicesWithLeadershipControl
public class EmbeddedHaServices extends AbstractNonHaServices
An implementation of theHighAvailabilityServicesfor the non-high-availability case where all participants (ResourceManager, JobManagers, TaskManagers) run in the same process.This implementation has no dependencies on any external services. It returns a fix pre-configured ResourceManager, and stores checkpoints and metadata simply on the heap or on a local file system and therefore in a storage without guarantees.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.highavailability.nonha.AbstractNonHaServices
lock
-
Fields inherited from interface org.apache.flink.runtime.highavailability.HighAvailabilityServices
DEFAULT_JOB_ID, DEFAULT_LEADER_ID
-
-
Constructor Summary
Constructors Constructor Description EmbeddedHaServices(Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the high availability services, releasing all resources.LeaderElectiongetClusterRestEndpointLeaderElection()Gets theLeaderElectionfor the cluster's rest endpoint.LeaderRetrievalServicegetClusterRestEndpointLeaderRetriever()Get the leader retriever for the cluster's rest endpoint.LeaderElectiongetDispatcherLeaderElection()Gets theLeaderElectionfor the cluster's dispatcher.LeaderRetrievalServicegetDispatcherLeaderRetriever()Gets the leader retriever for the dispatcher.LeaderElectiongetJobManagerLeaderElection(org.apache.flink.api.common.JobID jobID)Gets theLeaderElectionfor the job with the givenJobID.LeaderRetrievalServicegetJobManagerLeaderRetriever(org.apache.flink.api.common.JobID jobID)Gets the leader retriever for the job JobMaster which is responsible for the given job.LeaderRetrievalServicegetJobManagerLeaderRetriever(org.apache.flink.api.common.JobID jobID, String defaultJobManagerAddress)Gets the leader retriever for the job JobMaster which is responsible for the given job.LeaderElectiongetResourceManagerLeaderElection()Gets theLeaderElectionfor the cluster's resource manager.LeaderRetrievalServicegetResourceManagerLeaderRetriever()Gets the leader retriever for the cluster's resource manager.-
Methods inherited from class org.apache.flink.runtime.highavailability.nonha.AbstractNonHaServices
checkNotShutdown, cleanupAllData, createBlobStore, getCheckpointRecoveryFactory, getExecutionPlanStore, getJobResultStore, isShutDown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.highavailability.HighAvailabilityServices
closeWithOptionalClean, getWebMonitorLeaderElection, getWebMonitorLeaderRetriever, globalCleanupAsync
-
-
-
-
Constructor Detail
-
EmbeddedHaServices
public EmbeddedHaServices(Executor executor)
-
-
Method Detail
-
getResourceManagerLeaderRetriever
public LeaderRetrievalService getResourceManagerLeaderRetriever()
Description copied from interface:HighAvailabilityServicesGets the leader retriever for the cluster's resource manager.
-
getDispatcherLeaderRetriever
public LeaderRetrievalService getDispatcherLeaderRetriever()
Description copied from interface:HighAvailabilityServicesGets the leader retriever for the dispatcher. This leader retrieval service is not always accessible.
-
getResourceManagerLeaderElection
public LeaderElection getResourceManagerLeaderElection()
Description copied from interface:HighAvailabilityServicesGets theLeaderElectionfor the cluster's resource manager.
-
getDispatcherLeaderElection
public LeaderElection getDispatcherLeaderElection()
Description copied from interface:HighAvailabilityServicesGets theLeaderElectionfor the cluster's dispatcher.
-
getJobManagerLeaderRetriever
public LeaderRetrievalService getJobManagerLeaderRetriever(org.apache.flink.api.common.JobID jobID)
Description copied from interface:HighAvailabilityServicesGets the leader retriever for the job JobMaster which is responsible for the given job.- Parameters:
jobID- The identifier of the job.- Returns:
- Leader retrieval service to retrieve the job manager for the given job
-
getJobManagerLeaderRetriever
public LeaderRetrievalService getJobManagerLeaderRetriever(org.apache.flink.api.common.JobID jobID, String defaultJobManagerAddress)
Description copied from interface:HighAvailabilityServicesGets the leader retriever for the job JobMaster which is responsible for the given job.- Parameters:
jobID- The identifier of the job.defaultJobManagerAddress- JobManager address which will be returned by a static leader retrieval service.- Returns:
- Leader retrieval service to retrieve the job manager for the given job
-
getClusterRestEndpointLeaderRetriever
public LeaderRetrievalService getClusterRestEndpointLeaderRetriever()
Description copied from interface:ClientHighAvailabilityServicesGet the leader retriever for the cluster's rest endpoint.- Returns:
- the leader retriever for cluster's rest endpoint.
-
getJobManagerLeaderElection
public LeaderElection getJobManagerLeaderElection(org.apache.flink.api.common.JobID jobID)
Description copied from interface:HighAvailabilityServicesGets theLeaderElectionfor the job with the givenJobID.
-
getClusterRestEndpointLeaderElection
public LeaderElection getClusterRestEndpointLeaderElection()
Description copied from interface:HighAvailabilityServicesGets theLeaderElectionfor the cluster's rest endpoint.
-
close
public void close() throws ExceptionDescription copied from interface:HighAvailabilityServicesCloses the high availability services, releasing all resources.This method does not delete or clean up any data stored in external stores (file systems, ZooKeeper, etc). Another instance of the high availability services will be able to recover the job.
If an exception occurs during closing services, this method will attempt to continue closing other services and report exceptions only after all services have been attempted to be closed.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceHighAvailabilityServices- Overrides:
closein classAbstractNonHaServices- Throws:
Exception- Thrown, if an exception occurred while closing these services.
-
-