@Evolving public interface SupportsCatalogs
Modifier and Type | Method and Description |
---|---|
Catalog |
alterCatalog(java.lang.String catalogName,
CatalogChange... changes)
Alter a catalog with specified catalog name and changes.
|
default boolean |
catalogExists(java.lang.String catalogName)
Check if a catalog exists.
|
default Catalog |
createCatalog(java.lang.String catalogName,
Catalog.Type type,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a managed catalog with specified catalog name, type, comment, and properties.
|
Catalog |
createCatalog(java.lang.String catalogName,
Catalog.Type type,
java.lang.String provider,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a catalog with specified catalog name, type, provider, comment, and properties.
|
void |
disableCatalog(java.lang.String catalogName)
Disable a catalog.
|
default boolean |
dropCatalog(java.lang.String catalogName)
Drop a catalog with specified name.
|
boolean |
dropCatalog(java.lang.String catalogName,
boolean force)
Drop a catalog with specified name.
|
void |
enableCatalog(java.lang.String catalogName)
Enable a catalog.
|
java.lang.String[] |
listCatalogs()
List the name of all catalogs in the metalake.
|
Catalog[] |
listCatalogsInfo()
List all catalogs with their information in the metalake.
|
Catalog |
loadCatalog(java.lang.String catalogName)
Load a catalog by its name.
|
void |
testConnection(java.lang.String catalogName,
Catalog.Type type,
java.lang.String provider,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Test whether the catalog with specified parameters can be connected to before creating it.
|
java.lang.String[] listCatalogs() throws NoSuchMetalakeException
NoSuchMetalakeException
- If the metalake does not exist.Catalog[] listCatalogsInfo() throws NoSuchMetalakeException
NoSuchMetalakeException
- If the metalake with namespace does not exist.Catalog loadCatalog(java.lang.String catalogName) throws NoSuchCatalogException
catalogName
- the name of the catalog.NoSuchCatalogException
- If the catalog does not exist.default boolean catalogExists(java.lang.String catalogName)
catalogName
- The name of the catalog.Catalog createCatalog(java.lang.String catalogName, Catalog.Type type, java.lang.String provider, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchMetalakeException, CatalogAlreadyExistsException
The parameter "provider" is a short name of the catalog, used to tell Gravitino which catalog should be created. The short name:
1) should be the same as the CatalogProvider
interface provided. 2) can be "null" if
the created catalog is the managed catalog, like model catalog. For the details of the provider
definition, see CatalogProvider
.
catalogName
- the name of the catalog.type
- the type of the catalog.provider
- the provider of the catalog, or null if the catalog is a managed catalog.comment
- the comment of the catalog.properties
- the properties of the catalog.NoSuchMetalakeException
- If the metalake does not exist.CatalogAlreadyExistsException
- If the catalog already exists.default Catalog createCatalog(java.lang.String catalogName, Catalog.Type type, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchMetalakeException, CatalogAlreadyExistsException
catalogName
- the name of the catalog.type
- the type of the catalog.comment
- the comment of the catalog.properties
- the properties of the catalog.NoSuchMetalakeException
- If the metalake does not exist.CatalogAlreadyExistsException
- If the catalog already exists.Catalog alterCatalog(java.lang.String catalogName, CatalogChange... changes) throws NoSuchCatalogException, java.lang.IllegalArgumentException
catalogName
- the name of the catalog.changes
- the changes to apply to the catalog.NoSuchCatalogException
- If the catalog does not exist.java.lang.IllegalArgumentException
- If the changes cannot be applied to the catalog.default boolean dropCatalog(java.lang.String catalogName) throws NonEmptyEntityException, CatalogInUseException
NonEmptyEntityException
will be
thrown.
disableCatalog(String)
has been called before dropping the catalog.
Otherwise, a CatalogInUseException
will be thrown.
dropCatalog(ident, false)
.catalogName
- the name of the catalog.NonEmptyEntityException
- If the catalog is not empty.CatalogInUseException
- If the catalog is in use.boolean dropCatalog(java.lang.String catalogName, boolean force) throws NonEmptyEntityException, CatalogInUseException
dropCatalog(String)
.catalogName
- The identifier of the catalog.force
- Whether to force the drop.NonEmptyEntityException
- If the catalog is not empty and force is false.CatalogInUseException
- If the catalog is in use and force is false.void enableCatalog(java.lang.String catalogName) throws NoSuchCatalogException
catalogName
- The identifier of the catalog.NoSuchCatalogException
- If the catalog does not exist.void disableCatalog(java.lang.String catalogName) throws NoSuchCatalogException
CatalogNotInUseException
.
CatalogNotInUseException
.
catalogName
- The identifier of the catalog.NoSuchCatalogException
- If the catalog does not exist.void testConnection(java.lang.String catalogName, Catalog.Type type, java.lang.String provider, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception
catalogName
- the name of the catalog.type
- the type of the catalog.provider
- the provider of the catalog.comment
- the comment of the catalog.properties
- the properties of the catalog.java.lang.Exception
- if the test failed.