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 Object
lock
-
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 void
checkNotShutdown()
void
cleanupAllData()
Deletes all data stored by high availability services in external stores.void
close()
Closes the high availability services, releasing all resources.BlobStore
createBlobStore()
Creates the BLOB store in which BLOBs are stored in a highly-available fashion.CheckpointRecoveryFactory
getCheckpointRecoveryFactory()
Gets the checkpoint recovery factory for the job manager.ExecutionPlanStore
getExecutionPlanStore()
Gets the submitted execution plan store for the job manager.JobResultStore
getJobResultStore()
Gets the store that holds information about the state of finished jobs.protected boolean
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, 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:HighAvailabilityServices
Gets the checkpoint recovery factory for the job manager.- Specified by:
getCheckpointRecoveryFactory
in interfaceHighAvailabilityServices
- Returns:
- Checkpoint recovery factory
-
getExecutionPlanStore
public ExecutionPlanStore getExecutionPlanStore() throws Exception
Description copied from interface:HighAvailabilityServices
Gets the submitted execution plan store for the job manager.- Specified by:
getExecutionPlanStore
in 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:HighAvailabilityServices
Gets the store that holds information about the state of finished jobs.- Specified by:
getJobResultStore
in 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:HighAvailabilityServices
Creates the BLOB store in which BLOBs are stored in a highly-available fashion.- Specified by:
createBlobStore
in interfaceHighAvailabilityServices
- Returns:
- Blob store
- Throws:
IOException
- if the blob store could not be created
-
close
public void close() throws Exception
Description copied from interface:HighAvailabilityServices
Closes 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceHighAvailabilityServices
- Throws:
Exception
- Thrown, if an exception occurred while closing these services.
-
cleanupAllData
public void cleanupAllData() throws Exception
Description copied from interface:HighAvailabilityServices
Deletes 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:
cleanupAllData
in interfaceHighAvailabilityServices
- Throws:
Exception
- if an error occurred while cleaning up data stored by them.
-
checkNotShutdown
protected void checkNotShutdown()
-
isShutDown
protected boolean isShutDown()
-
-