public class EcsCatalog extends BaseMetastoreCatalog implements SupportsNamespaces, Configurable<java.lang.Object>
BaseMetastoreCatalog.BaseMetastoreCatalogTableBuilderCatalog.TableBuilder| Constructor and Description |
|---|
EcsCatalog()
No-arg constructor to load the catalog dynamically.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
createNamespace(Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a namespace in the catalog.
|
protected java.lang.String |
defaultWarehouseLocation(TableIdentifier tableIdentifier) |
boolean |
dropNamespace(Namespace namespace)
Drop a namespace.
|
boolean |
dropTable(TableIdentifier identifier,
boolean purge)
Remove table object.
|
void |
initialize(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
Initialize a catalog given a custom name and a map of catalog properties.
|
java.util.List<Namespace> |
listNamespaces(Namespace namespace)
List child namespaces from the namespace.
|
java.util.List<TableIdentifier> |
listTables(Namespace namespace)
Iterate all table objects with the namespace prefix.
|
java.util.Map<java.lang.String,java.lang.String> |
loadNamespaceMetadata(Namespace namespace)
Load namespace properties.
|
java.lang.String |
name()
Return the name for this catalog.
|
boolean |
namespaceExists(Namespace namespace)
Checks whether the Namespace exists.
|
protected TableOperations |
newTableOps(TableIdentifier tableIdentifier) |
java.util.Optional<com.emc.object.s3.S3ObjectMetadata> |
objectMetadata(org.apache.iceberg.dell.ecs.EcsURI uri)
Get S3 object metadata which include E-Tag, user metadata and so on.
|
protected java.util.Map<java.lang.String,java.lang.String> |
properties() |
boolean |
removeProperties(Namespace namespace,
java.util.Set<java.lang.String> properties)
Remove a set of property keys from a namespace in the catalog.
|
void |
renameTable(TableIdentifier from,
TableIdentifier to)
Table rename will only move table object, the data objects will still be in-place.
|
void |
setConf(java.lang.Object conf) |
boolean |
setProperties(Namespace namespace,
java.util.Map<java.lang.String,java.lang.String> properties)
Set a collection of properties on a namespace in the catalog.
|
boolean |
tableExists(TableIdentifier identifier)
Check whether table exists.
|
boolean |
updateProperties(Namespace namespace,
java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.String>> propertiesFn) |
buildTable, fullTableName, isValidIdentifier, loadTable, metricsReporter, registerTable, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateNamespace, listNamespacescreateTable, createTable, createTable, createTable, dropTable, invalidateTable, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransactionpublic EcsCatalog()
All fields are initialized by calling initialize(String, Map) later.
public void initialize(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
CatalogA custom Catalog implementation must have a no-arg constructor. A compute engine like Spark or Flink will first initialize the catalog without any arguments, and then call this method to complete catalog initialization with properties passed into the engine.
initialize in interface Catalogname - a custom name for the catalogproperties - catalog propertiesprotected TableOperations newTableOps(TableIdentifier tableIdentifier)
newTableOps in class BaseMetastoreCatalogprotected java.lang.String defaultWarehouseLocation(TableIdentifier tableIdentifier)
defaultWarehouseLocation in class BaseMetastoreCatalogpublic java.util.List<TableIdentifier> listTables(Namespace namespace)
listTables in interface Catalognamespace - a namespacepublic boolean dropTable(TableIdentifier identifier, boolean purge)
public void renameTable(TableIdentifier from, TableIdentifier to)
renameTable in interface Catalogfrom - identifier of the table to renameto - new table namepublic void createNamespace(Namespace namespace, java.util.Map<java.lang.String,java.lang.String> properties)
SupportsNamespacescreateNamespace in interface SupportsNamespacesnamespace - a multi-part namespaceproperties - a string Map of properties for the given namespacepublic java.util.List<Namespace> listNamespaces(Namespace namespace) throws NoSuchNamespaceException
SupportsNamespacesFor 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 SupportsNamespacesNamespace names from the given namespaceNoSuchNamespaceException - If the namespace does not exist (optional)public java.util.Map<java.lang.String,java.lang.String> loadNamespaceMetadata(Namespace namespace) throws NoSuchNamespaceException
loadNamespaceMetadata in interface SupportsNamespacesnamespace - a namespace. NamespaceNoSuchNamespaceException - If the namespace does not exist (optional)public 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> properties) throws NoSuchNamespaceException
SupportsNamespacesProperties that are not in the given map are not modified or removed by this method.
setProperties in interface SupportsNamespacesnamespace - a namespace. Namespaceproperties - a collection of metadata to apply to the namespaceNoSuchNamespaceException - If the namespace does not exist (optional)public boolean removeProperties(Namespace namespace, java.util.Set<java.lang.String> properties) throws NoSuchNamespaceException
SupportsNamespacesProperties that are not in the given set are not modified or removed by this method.
removeProperties in interface SupportsNamespacesnamespace - a namespace. Namespaceproperties - a collection of metadata to apply to the namespaceNoSuchNamespaceException - If the namespace does not exist (optional)public boolean updateProperties(Namespace namespace, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.String>> propertiesFn) throws NoSuchNamespaceException
NoSuchNamespaceExceptionpublic boolean namespaceExists(Namespace namespace)
SupportsNamespacesnamespaceExists in interface SupportsNamespacesnamespace - a namespace. Namespacepublic boolean tableExists(TableIdentifier identifier)
CatalogtableExists in interface Catalogidentifier - a table identifierpublic java.util.Optional<com.emc.object.s3.S3ObjectMetadata> objectMetadata(org.apache.iceberg.dell.ecs.EcsURI uri)
public java.lang.String name()
Catalogpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class BaseMetastoreCatalogjava.io.IOExceptionpublic void setConf(java.lang.Object conf)
setConf in interface Configurable<java.lang.Object>protected java.util.Map<java.lang.String,java.lang.String> properties()
properties in class BaseMetastoreCatalog