@Internal
public class FileCatalogStore
extends org.apache.flink.table.catalog.AbstractCatalogStore
CatalogStore that stores all catalog configuration to a directory. Configuration of
every catalog will be saved into a single file. The file name will be {catalogName}.yaml by
default.| Constructor and Description |
|---|
FileCatalogStore(String catalogStorePath)
Creates a new
FileCatalogStore instance with the specified directory path. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String catalogName)
Returns whether the specified catalog exists in the catalog store.
|
Optional<org.apache.flink.table.catalog.CatalogDescriptor> |
getCatalog(String catalogName)
Returns the catalog descriptor for the specified catalog, if it exists in the catalog store.
|
Set<String> |
listCatalogs()
Returns a set of all catalog names in the catalog store.
|
void |
open()
Opens the catalog store and initializes the catalog file map.
|
void |
removeCatalog(String catalogName,
boolean ignoreIfNotExists)
Removes the specified catalog from the catalog store.
|
void |
storeCatalog(String catalogName,
org.apache.flink.table.catalog.CatalogDescriptor catalog)
Stores the specified catalog in the catalog store.
|
public FileCatalogStore(String catalogStorePath)
FileCatalogStore instance with the specified directory path.catalogStorePath - the directory path where catalog configurations will be storedpublic void open()
throws org.apache.flink.table.catalog.exceptions.CatalogException
open in interface org.apache.flink.table.catalog.CatalogStoreopen in class org.apache.flink.table.catalog.AbstractCatalogStoreorg.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store directory does not exist, not a directory, or
if there is an error reading the directorypublic void storeCatalog(String catalogName, org.apache.flink.table.catalog.CatalogDescriptor catalog) throws org.apache.flink.table.catalog.exceptions.CatalogException
catalogName - the name of the catalogcatalog - the catalog descriptor to storeorg.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store is not open or if there is an error storing the
catalogpublic void removeCatalog(String catalogName, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.CatalogException
catalogName - the name of the catalog to removeignoreIfNotExists - whether to ignore if the catalog does not exist in the catalog storeorg.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store is not open or if there is an error removing
the catalogpublic Optional<org.apache.flink.table.catalog.CatalogDescriptor> getCatalog(String catalogName) throws org.apache.flink.table.catalog.exceptions.CatalogException
catalogName - the name of the catalog to retrieveOptional containing the catalog descriptor, or an empty Optional
if the catalog does not exist in the catalog storeorg.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store is not open or if there is an error retrieving
the catalogpublic Set<String> listCatalogs() throws org.apache.flink.table.catalog.exceptions.CatalogException
org.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store is not open or if there is an error retrieving
the list of catalog namespublic boolean contains(String catalogName) throws org.apache.flink.table.catalog.exceptions.CatalogException
catalogName - the name of the catalog to checktrue if the catalog exists in the catalog store, false otherwiseorg.apache.flink.table.catalog.exceptions.CatalogException - if the catalog store is not open or if there is an error checking
for the catalogCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.