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 child 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, wait
createTable, createTable, createTable, createTable, initialize, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction
createNamespace, listNamespaces
public java.lang.String name()
Catalog
public java.util.List<TableIdentifier> listTables(Namespace namespace)
Catalog
listTables
in interface Catalog
namespace
- a namespacepublic Catalog.TableBuilder buildTable(TableIdentifier ident, Schema schema)
Catalog
buildTable
in interface Catalog
ident
- a table identifierschema
- a schemapublic Table registerTable(TableIdentifier ident, java.lang.String metadataFileLocation)
Catalog
registerTable
in interface Catalog
ident
- a table identifiermetadataFileLocation
- the location of a metadata filepublic boolean tableExists(TableIdentifier ident)
Catalog
tableExists
in interface Catalog
ident
- a table identifierpublic Table loadTable(TableIdentifier ident)
Catalog
public boolean dropTable(TableIdentifier ident)
Catalog
public boolean dropTable(TableIdentifier ident, boolean purge)
Catalog
If purge is set to true the implementation should delete all data and metadata files.
public void renameTable(TableIdentifier from, TableIdentifier to)
Catalog
renameTable
in interface Catalog
from
- identifier of the table to renameto
- new table namepublic void invalidateTable(TableIdentifier ident)
Catalog
If 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 Catalog
ident
- a table identifierpublic void createNamespace(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> metadata)
SupportsNamespaces
createNamespace
in interface SupportsNamespaces
namespace
- a multi-part namespacemetadata
- a string Map of properties for the given namespacepublic java.util.List<Namespace> listNamespaces(Namespace namespace)
SupportsNamespaces
For two existing tables named 'a.b.c.table' and 'a.b.d.table', this method returns:
Namespace.empty()
Namespace.of("a")
Namespace.of("a")
Namespace.of("a", "b")
Namespace.of("a", "b")
Namespace.of("a", "b", "c")
and Namespace.of("a", "b", "d")
Namespace.of("a", "b", "c")
listNamespaces
in interface SupportsNamespaces
Namespace
names from the given namespacepublic java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(Namespace namespace)
SupportsNamespaces
loadNamespaceMetadata
in interface SupportsNamespaces
namespace
- a namespace. Namespace
public boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException
SupportsNamespaces
dropNamespace
in interface SupportsNamespaces
namespace
- a namespace. Namespace
NamespaceNotEmptyException
- If the namespace is not emptypublic boolean setProperties(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> updates)
SupportsNamespaces
Properties that are not in the given map are not modified or removed by this method.
setProperties
in interface SupportsNamespaces
namespace
- a namespace. Namespace
updates
- a collection of metadata to apply to the namespacepublic boolean removeProperties(Namespace namespace, java.util.Set<java.lang.String> removals)
SupportsNamespaces
Properties that are not in the given set are not modified or removed by this method.
removeProperties
in interface SupportsNamespaces
namespace
- a namespace. Namespace
removals
- a collection of metadata to apply to the namespacepublic boolean namespaceExists(Namespace namespace)
SupportsNamespaces
namespaceExists
in interface SupportsNamespaces
namespace
- a namespace. Namespace