Package org.apache.flink.table.catalog
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 TypeMethodDescriptionvoidclose()Close the catalog store when it is no longer needed and release any resource that it might be holding.booleanReturn whether the catalog exists in the catalog store.getCatalog(String catalogName) Get a catalog by name.Retrieves the names of all registered catalogs.voidopen()Open the catalog store.voidremoveCatalog(String catalogName, boolean ignoreIfNotExists) Remove a catalog with the given catalog name.voidstoreCatalog(String catalogName, CatalogDescriptor catalog) Stores a catalog under the given catalog name.
-
Method Details
-
storeCatalog
void storeCatalog(String catalogName, CatalogDescriptor catalog) throws org.apache.flink.table.catalog.exceptions.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 catalogcatalog- catalog descriptor to store- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- throw when registration failed
-
removeCatalog
void removeCatalog(String catalogName, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.CatalogException Remove a catalog with the given catalog name.- Parameters:
catalogName- the given catalog name under which to remove the given catalogignoreIfNotExists- whether throw an exception when the catalog does not exist- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- throw when the removal operation failed
-
getCatalog
Optional<CatalogDescriptor> getCatalog(String catalogName) throws org.apache.flink.table.catalog.exceptions.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:
org.apache.flink.table.catalog.exceptions.CatalogException- in case of any runtime exception
-
listCatalogs
Retrieves the names of all registered catalogs.- Returns:
- the names of registered catalogs
- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- in case of any runtime exception
-
contains
boolean contains(String catalogName) throws org.apache.flink.table.catalog.exceptions.CatalogException Return whether the catalog exists in the catalog store.- Parameters:
catalogName- the name of catalog- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- in case of any runtime exception
-
open
void open() throws org.apache.flink.table.catalog.exceptions.CatalogExceptionOpen the catalog store. Used for any required preparation in initialization phase.- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- in case of any runtime exception
-
close
void close() throws org.apache.flink.table.catalog.exceptions.CatalogExceptionClose the catalog store when it is no longer needed and release any resource that it might be holding.- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException- in case of any runtime exception
-