Interface CatalogStore

All Known Implementing Classes:
AbstractCatalogStore

@PublicEvolving public interface CatalogStore
Represents the storage where persists all Catalogs.

All catalogs can be lazy initialized with the CatalogStore.

It can be used in CatalogManager to retrieve, save and remove catalog in CatalogDescriptor format at the external storage system.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the catalog store when it is no longer needed and release any resource that it might be holding.
    boolean
    contains(String catalogName)
    Return whether the catalog exists in the catalog store.
    getCatalog(String catalogName)
    Get a catalog by name.
    Retrieves the names of all registered catalogs.
    void
    Open the catalog store.
    void
    removeCatalog(String catalogName, boolean ignoreIfNotExists)
    Remove a catalog with the given catalog name.
    void
    storeCatalog(String catalogName, CatalogDescriptor catalog)
    Stores a catalog under the given catalog name.
  • Method Details

    • storeCatalog

      void storeCatalog(String catalogName, CatalogDescriptor catalog) throws CatalogException
      Stores a catalog under the given catalog name. The catalog name must be unique.
      Parameters:
      catalogName - the given catalog name under which to store the given catalog
      catalog - catalog descriptor to store
      Throws:
      CatalogException - throw when registration failed
    • removeCatalog

      void removeCatalog(String catalogName, boolean ignoreIfNotExists) throws CatalogException
      Remove a catalog with the given catalog name.
      Parameters:
      catalogName - the given catalog name under which to remove the given catalog
      ignoreIfNotExists - whether throw an exception when the catalog does not exist
      Throws:
      CatalogException - throw when the removal operation failed
    • getCatalog

      Optional<CatalogDescriptor> getCatalog(String catalogName) throws CatalogException
      Get a catalog by name.
      Parameters:
      catalogName - name of the catalog to retrieve
      Returns:
      the requested catalog or empty if the catalog does not exist
      Throws:
      CatalogException - in case of any runtime exception
    • listCatalogs

      Set<String> listCatalogs() throws CatalogException
      Retrieves the names of all registered catalogs.
      Returns:
      the names of registered catalogs
      Throws:
      CatalogException - in case of any runtime exception
    • contains

      boolean contains(String catalogName) throws CatalogException
      Return whether the catalog exists in the catalog store.
      Parameters:
      catalogName - the name of catalog
      Throws:
      CatalogException - in case of any runtime exception
    • open

      void open() throws CatalogException
      Open the catalog store. Used for any required preparation in initialization phase.
      Throws:
      CatalogException - in case of any runtime exception
    • close

      void close() throws CatalogException
      Close the catalog store when it is no longer needed and release any resource that it might be holding.
      Throws:
      CatalogException - in case of any runtime exception