public class BaseSessionCatalog.AsCatalog extends java.lang.Object implements Catalog, SupportsNamespaces
Catalog.TableBuilder| Modifier and Type | Method and Description |
|---|---|
Catalog.TableBuilder |
buildTable(TableIdentifier ident,
Schema schema)
/** Instantiate a builder to either create a table or start a create/replace transaction.
|
void |
createNamespace(Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> metadata)
Create a namespace in the catalog.
|
boolean |
dropNamespace(Namespace namespace)
Drop a namespace.
|
boolean |
dropTable(TableIdentifier ident)
Drop a table and delete all data and metadata files.
|
boolean |
dropTable(TableIdentifier ident,
boolean purge)
Drop a table; optionally delete data and metadata files.
|
void |
invalidateTable(TableIdentifier ident)
Invalidate cached table metadata from current catalog.
|
java.util.List<Namespace> |
listNamespaces(Namespace namespace)
List namespaces from the namespace.
|
java.util.List<TableIdentifier> |
listTables(Namespace namespace)
Return all the identifiers under this namespace.
|
java.util.Map<java.lang.String,java.lang.String> |
loadNamespaceMetadata(Namespace namespace)
Load metadata properties for a namespace.
|
Table |
loadTable(TableIdentifier ident)
Load a table.
|
java.lang.String |
name()
Return the name for this catalog.
|
boolean |
namespaceExists(Namespace namespace)
Checks whether the Namespace exists.
|
Table |
registerTable(TableIdentifier ident,
java.lang.String metadataFileLocation)
Register a table with the catalog if it does not exist.
|
boolean |
removeProperties(Namespace namespace,
java.util.Set<java.lang.String> removals)
Remove a set of property keys from a namespace in the catalog.
|
void |
renameTable(TableIdentifier from,
TableIdentifier to)
Rename a table.
|
boolean |
setProperties(Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> updates)
Set a collection of properties on a namespace in the catalog.
|
boolean |
tableExists(TableIdentifier ident)
Check whether table exists.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateTable, createTable, createTable, createTable, initialize, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransactioncreateNamespace, listNamespacespublic java.lang.String name()
Catalogpublic java.util.List<TableIdentifier> listTables(Namespace namespace)
CataloglistTables in interface Catalognamespace - a namespacepublic Catalog.TableBuilder buildTable(TableIdentifier ident, Schema schema)
CatalogbuildTable in interface Catalogident - a table identifierschema - a schemapublic Table registerTable(TableIdentifier ident, java.lang.String metadataFileLocation)
CatalogregisterTable in interface Catalogident - a table identifiermetadataFileLocation - the location of a metadata filepublic boolean tableExists(TableIdentifier ident)
CatalogtableExists in interface Catalogident - a table identifierpublic Table loadTable(TableIdentifier ident)
Catalogpublic boolean dropTable(TableIdentifier ident)
Catalogpublic boolean dropTable(TableIdentifier ident, boolean purge)
CatalogIf purge is set to true the implementation should delete all data and metadata files.
public void renameTable(TableIdentifier from, TableIdentifier to)
CatalogrenameTable in interface Catalogfrom - identifier of the table to renameto - new table namepublic void invalidateTable(TableIdentifier ident)
CatalogIf the table is already loaded or cached, drop cached data. If the table does not exist or is not cached, do nothing.
invalidateTable in interface Catalogident - a table identifierpublic void createNamespace(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> metadata)
SupportsNamespacescreateNamespace in interface SupportsNamespacesnamespace - a multi-part namespacemetadata - a string Map of properties for the given namespacepublic java.util.List<Namespace> listNamespaces(Namespace namespace)
SupportsNamespacesFor example, if table a.b.t exists, use 'SELECT NAMESPACE IN a' this method must return
Namepace.of("a","b") Namespace.
listNamespaces in interface SupportsNamespacesNamespace namespublic java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(Namespace namespace)
SupportsNamespacesloadNamespaceMetadata in interface SupportsNamespacesnamespace - a namespace. Namespacepublic boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException
SupportsNamespacesdropNamespace in interface SupportsNamespacesnamespace - a namespace. NamespaceNamespaceNotEmptyException - If the namespace is not emptypublic boolean setProperties(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> updates)
SupportsNamespacesProperties that are not in the given map are not modified or removed by this method.
setProperties in interface SupportsNamespacesnamespace - a namespace. Namespaceupdates - a collection of metadata to apply to the namespacepublic boolean removeProperties(Namespace namespace, java.util.Set<java.lang.String> removals)
SupportsNamespacesProperties that are not in the given set are not modified or removed by this method.
removeProperties in interface SupportsNamespacesnamespace - a namespace. Namespaceremovals - a collection of metadata to apply to the namespacepublic boolean namespaceExists(Namespace namespace)
SupportsNamespacesnamespaceExists in interface SupportsNamespacesnamespace - a namespace. Namespace