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 Details

    • lock

      protected final Object lock
  • Constructor Details

    • AbstractNonHaServices

      public AbstractNonHaServices()
  • Method Details

    • getCheckpointRecoveryFactory

      public CheckpointRecoveryFactory getCheckpointRecoveryFactory()
      Description copied from interface: HighAvailabilityServices
      Gets the checkpoint recovery factory for the job manager.
      Specified by:
      getCheckpointRecoveryFactory in interface HighAvailabilityServices
      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 interface HighAvailabilityServices
      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 interface HighAvailabilityServices
      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 interface HighAvailabilityServices
      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 interface AutoCloseable
      Specified by:
      close in interface HighAvailabilityServices
      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 interface HighAvailabilityServices
      Throws:
      Exception - if an error occurred while cleaning up data stored by them.
    • checkNotShutdown

      protected void checkNotShutdown()
    • isShutDown

      protected boolean isShutDown()