public class RESTSessionCatalog extends BaseSessionCatalog implements Configurable<org.apache.hadoop.conf.Configuration>, java.io.Closeable
BaseSessionCatalog.AsCatalogSessionCatalog.SessionContext| Constructor and Description |
|---|
RESTSessionCatalog() |
| Modifier and Type | Method and Description |
|---|---|
Catalog.TableBuilder |
buildTable(SessionCatalog.SessionContext context,
TableIdentifier identifier,
Schema schema)
Create a builder to create a table or start a create/replace transaction.
|
void |
close() |
void |
createNamespace(SessionCatalog.SessionContext context,
Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> metadata)
Create a namespace in the catalog.
|
boolean |
dropNamespace(SessionCatalog.SessionContext context,
Namespace ns)
Drop a namespace.
|
boolean |
dropTable(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Drop a table, without requesting that files are immediately deleted.
|
void |
initialize(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> unresolved)
Initialize given a custom name and a map of catalog properties.
|
void |
invalidateTable(SessionCatalog.SessionContext context,
TableIdentifier ident)
Invalidate cached table metadata from current catalog.
|
java.util.List<Namespace> |
listNamespaces(SessionCatalog.SessionContext context,
Namespace namespace)
List namespaces from the namespace.
|
java.util.List<TableIdentifier> |
listTables(SessionCatalog.SessionContext context,
Namespace ns)
Return all the identifiers under this namespace.
|
java.util.Map<java.lang.String,java.lang.String> |
loadNamespaceMetadata(SessionCatalog.SessionContext context,
Namespace ns)
Load metadata properties for a namespace.
|
Table |
loadTable(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Load a table.
|
boolean |
purgeTable(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Drop a table and request that files are immediately deleted.
|
Table |
registerTable(SessionCatalog.SessionContext context,
TableIdentifier ident,
java.lang.String metadataFileLocation)
Register a table if it does not exist.
|
void |
renameTable(SessionCatalog.SessionContext context,
TableIdentifier from,
TableIdentifier to)
Rename a table.
|
void |
setConf(org.apache.hadoop.conf.Configuration newConf) |
boolean |
updateNamespaceMetadata(SessionCatalog.SessionContext context,
Namespace ns,
java.util.Map<java.lang.String,java.lang.String> updates,
java.util.Set<java.lang.String> removals)
Set a collection of properties on a namespace in the catalog.
|
asCatalog, name, properties, withContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateNamespace, listNamespaces, namespaceExists, tableExistspublic void initialize(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> unresolved)
SessionCataloginitialize in interface SessionCataloginitialize in class BaseSessionCatalogname - a custom name for the catalogunresolved - catalog propertiespublic void setConf(org.apache.hadoop.conf.Configuration newConf)
setConf in interface Configurable<org.apache.hadoop.conf.Configuration>public java.util.List<TableIdentifier> listTables(SessionCatalog.SessionContext context, Namespace ns)
SessionCataloglistTables in interface SessionCatalogcontext - session contextns - a namespacepublic boolean dropTable(SessionCatalog.SessionContext context, TableIdentifier identifier)
SessionCatalogData and metadata files should be deleted according to the catalog's policy.
dropTable in interface SessionCatalogcontext - session contextidentifier - a table identifierpublic boolean purgeTable(SessionCatalog.SessionContext context, TableIdentifier identifier)
SessionCatalogpurgeTable in interface SessionCatalogcontext - session contextidentifier - a table identifierpublic void renameTable(SessionCatalog.SessionContext context, TableIdentifier from, TableIdentifier to)
SessionCatalogrenameTable in interface SessionCatalogcontext - session contextfrom - identifier of the table to renameto - new table namepublic Table loadTable(SessionCatalog.SessionContext context, TableIdentifier identifier)
SessionCatalogloadTable in interface SessionCatalogcontext - session contextidentifier - a table identifierTable implementation referred by tableIdentifierpublic Catalog.TableBuilder buildTable(SessionCatalog.SessionContext context, TableIdentifier identifier, Schema schema)
SessionCatalogbuildTable in interface SessionCatalogcontext - session contextidentifier - a table identifierschema - a schemapublic void invalidateTable(SessionCatalog.SessionContext context, TableIdentifier ident)
SessionCatalogIf 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 SessionCatalogcontext - session contextident - a table identifierpublic Table registerTable(SessionCatalog.SessionContext context, TableIdentifier ident, java.lang.String metadataFileLocation)
SessionCatalogregisterTable in interface SessionCatalogcontext - session contextident - a table identifiermetadataFileLocation - the location of a metadata filepublic void createNamespace(SessionCatalog.SessionContext context, Namespace namespace, java.util.Map<java.lang.String,java.lang.String> metadata)
SessionCatalogcreateNamespace in interface SessionCatalogcontext - session contextnamespace - a namespacemetadata - a string Map of properties for the given namespacepublic java.util.List<Namespace> listNamespaces(SessionCatalog.SessionContext context, Namespace namespace)
SessionCatalogFor example, if table a.b.t exists, use 'SELECT NAMESPACE IN a' this method must return
Namepace.of("a","b") Namespace.
listNamespaces in interface SessionCatalogcontext - session contextnamespace - a namespaceNamespace namespublic java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(SessionCatalog.SessionContext context, Namespace ns)
SessionCatalogloadNamespaceMetadata in interface SessionCatalogcontext - session contextns - a namespacepublic boolean dropNamespace(SessionCatalog.SessionContext context, Namespace ns)
SessionCatalogdropNamespace in interface SessionCatalogcontext - session contextns - a namespacepublic boolean updateNamespaceMetadata(SessionCatalog.SessionContext context, Namespace ns, java.util.Map<java.lang.String,java.lang.String> updates, java.util.Set<java.lang.String> removals)
SessionCatalogProperties that are not in the given map are not modified or removed by this method.
updateNamespaceMetadata in interface SessionCatalogcontext - session contextns - a namespaceupdates - properties to set for the namespaceremovals - properties to remove from the namespacepublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException