Class AbstractNonHaServices
- java.lang.Object
-
- org.apache.flink.runtime.highavailability.nonha.AbstractNonHaServices
-
- All Implemented Interfaces:
AutoCloseable,GloballyCleanableResource,ClientHighAvailabilityServices,HighAvailabilityServices
- Direct Known Subclasses:
EmbeddedHaServices,StandaloneHaServices
public abstract class AbstractNonHaServices extends Object implements HighAvailabilityServices
Abstract base class for non high-availability services.This class returns the standalone variants for the checkpoint recovery factory, the submitted execution plan store, the running jobs registry and the blob store.
-
-
Field Summary
Fields Modifier and Type Field Description protected Objectlock-
Fields inherited from interface org.apache.flink.runtime.highavailability.HighAvailabilityServices
DEFAULT_JOB_ID, DEFAULT_LEADER_ID
-
-
Constructor Summary
Constructors Constructor Description AbstractNonHaServices()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckNotShutdown()voidcleanupAllData()Deletes all data stored by high availability services in external stores.voidclose()Closes the high availability services, releasing all resources.BlobStorecreateBlobStore()Creates the BLOB store in which BLOBs are stored in a highly-available fashion.CheckpointRecoveryFactorygetCheckpointRecoveryFactory()Gets the checkpoint recovery factory for the job manager.ExecutionPlanStoregetExecutionPlanStore()Gets the submitted execution plan store for the job manager.JobResultStoregetJobResultStore()Gets the store that holds information about the state of finished jobs.protected booleanisShutDown()-
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, getClusterRestEndpointLeaderElection, getClusterRestEndpointLeaderRetriever, getDispatcherLeaderElection, getDispatcherLeaderRetriever, getJobManagerLeaderElection, getJobManagerLeaderRetriever, getJobManagerLeaderRetriever, getResourceManagerLeaderElection, getResourceManagerLeaderRetriever, getWebMonitorLeaderElection, getWebMonitorLeaderRetriever, globalCleanupAsync
-
-
-
-
Field Detail
-
lock
protected final Object lock
-
-
Method Detail
-
getCheckpointRecoveryFactory
public CheckpointRecoveryFactory getCheckpointRecoveryFactory()
Description copied from interface:HighAvailabilityServicesGets the checkpoint recovery factory for the job manager.- Specified by:
getCheckpointRecoveryFactoryin interfaceHighAvailabilityServices- Returns:
- Checkpoint recovery factory
-
getExecutionPlanStore
public ExecutionPlanStore getExecutionPlanStore() throws Exception
Description copied from interface:HighAvailabilityServicesGets the submitted execution plan store for the job manager.- Specified by:
getExecutionPlanStorein interfaceHighAvailabilityServices- Returns:
- Submitted execution plan store
- Throws:
Exception- if the submitted execution plan store could not be created
-
getJobResultStore
public JobResultStore getJobResultStore() throws Exception
Description copied from interface:HighAvailabilityServicesGets the store that holds information about the state of finished jobs.- Specified by:
getJobResultStorein interfaceHighAvailabilityServices- Returns:
- Store of finished job results
- Throws:
Exception- if job result store could not be created
-
createBlobStore
public BlobStore createBlobStore() throws IOException
Description copied from interface:HighAvailabilityServicesCreates the BLOB store in which BLOBs are stored in a highly-available fashion.- Specified by:
createBlobStorein interfaceHighAvailabilityServices- Returns:
- Blob store
- Throws:
IOException- if the blob store could not be created
-
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- Throws:
Exception- Thrown, if an exception occurred while closing these services.
-
cleanupAllData
public void cleanupAllData() throws ExceptionDescription copied from interface:HighAvailabilityServicesDeletes all data stored by high availability services in external stores.After this method was called, any job or session that was managed by these high availability services will be unrecoverable.
If an exception occurs during cleanup, this method will attempt to continue the cleanup and report exceptions only after all cleanup steps have been attempted.
- Specified by:
cleanupAllDatain interfaceHighAvailabilityServices- Throws:
Exception- if an error occurred while cleaning up data stored by them.
-
checkNotShutdown
protected void checkNotShutdown()
-
isShutDown
protected boolean isShutDown()
-
-