Interface Catalog
-
- All Known Implementing Classes:
InMemoryCatalog
@Internal public interface CatalogRepresents a named and configurable container for managing tables. Is defined with a type and configuration properties. Uses an underlyingMetaStoreto manage tables and table providers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancreateDatabase(java.lang.String databaseName)Creates a database with this name.@Nullable java.lang.StringcurrentDatabase()Produces the currently active database.booleandatabaseExists(java.lang.String db)Returns true if the database exists.java.util.Collection<java.lang.String>databases()Returns a collection of existing database names.booleandropDatabase(java.lang.String databaseName, boolean cascade)Drops the database with this name.MetaStoremetaStore(java.lang.String database)Returns the underlyingMetaStorefor this database.java.lang.Stringname()The name of this catalog, specified by the user.java.util.Map<java.lang.String,java.lang.String>properties()User-specified configuration properties.voidregisterTableProvider(TableProvider provider)Registers thisTableProviderand propagates it to underlyingMetaStores.java.util.Map<java.lang.String,TableProvider>tableProviders()Returns all theTableProviders available to thisCatalog, organized by type.java.lang.Stringtype()A type that defines this catalog.voiduseDatabase(java.lang.String databaseName)Switches to use the specified database.
-
-
-
Field Detail
-
DEFAULT
static final java.lang.String DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
type
java.lang.String type()
A type that defines this catalog.
-
metaStore
MetaStore metaStore(java.lang.String database)
-
currentDatabase
@Nullable java.lang.String currentDatabase()
Produces the currently active database. Can be null if no database is active.- Returns:
- the current active database
-
databases
java.util.Collection<java.lang.String> databases()
Returns a collection of existing database names.
-
createDatabase
boolean createDatabase(java.lang.String databaseName)
Creates a database with this name.- Parameters:
databaseName-- Returns:
- true if the database was created, false otherwise.
-
databaseExists
boolean databaseExists(java.lang.String db)
Returns true if the database exists.
-
useDatabase
void useDatabase(java.lang.String databaseName)
Switches to use the specified database.- Parameters:
databaseName-
-
dropDatabase
boolean dropDatabase(java.lang.String databaseName, boolean cascade)Drops the database with this name. If cascade is true, the catalog should first drop all tables contained in this database.- Parameters:
databaseName-cascade-- Returns:
- true if the database was dropped, false otherwise.
-
name
java.lang.String name()
The name of this catalog, specified by the user.
-
properties
java.util.Map<java.lang.String,java.lang.String> properties()
User-specified configuration properties.
-
registerTableProvider
void registerTableProvider(TableProvider provider)
Registers thisTableProviderand propagates it to underlyingMetaStores.
-
tableProviders
java.util.Map<java.lang.String,TableProvider> tableProviders()
Returns all theTableProviders available to thisCatalog, organized by type.
-
-