Package org.apache.flink.table.catalog
Interface CatalogStore
-
- All Known Implementing Classes:
AbstractCatalogStore
,FileCatalogStore
,GenericInMemoryCatalogStore
@PublicEvolving public interface CatalogStore
Represents the storage where persists allCatalog
s.All catalogs can be lazy initialized with the
CatalogStore
.It can be used in
CatalogManager
to retrieve, save and remove catalog inCatalogDescriptor
format at the external storage system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
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.Optional<CatalogDescriptor>
getCatalog(String catalogName)
Get a catalog by name.Set<String>
listCatalogs()
Retrieves the names of all registered catalogs.void
open()
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 Detail
-
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 catalogcatalog
- 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 catalogignoreIfNotExists
- 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
-
-