public abstract class BaseMetastoreCatalog extends java.lang.Object implements Catalog
| Constructor and Description |
|---|
BaseMetastoreCatalog() |
| Modifier and Type | Method and Description |
|---|---|
Table |
createTable(TableIdentifier identifier,
Schema schema,
PartitionSpec spec,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a table.
|
protected abstract java.lang.String |
defaultWarehouseLocation(TableIdentifier tableIdentifier) |
protected static void |
dropTableData(FileIO io,
TableMetadata metadata)
Drops all data and metadata files referenced by TableMetadata.
|
protected boolean |
isValidIdentifier(TableIdentifier tableIdentifier) |
Table |
loadTable(TableIdentifier identifier)
Load a table.
|
protected abstract java.lang.String |
name() |
Transaction |
newCreateTableTransaction(TableIdentifier identifier,
Schema schema,
PartitionSpec spec,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> properties)
Start a transaction to create a table.
|
Transaction |
newReplaceTableTransaction(TableIdentifier identifier,
Schema schema,
PartitionSpec spec,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> properties,
boolean orCreate)
Start a transaction to replace a table.
|
protected abstract TableOperations |
newTableOps(TableIdentifier tableIdentifier) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateTable, createTable, createTable, dropTable, dropTable, listTables, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, renameTable, tableExistspublic Table createTable(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
CatalogcreateTable in interface Catalogidentifier - a table identifierschema - a schemaspec - a partition speclocation - a location for the table; leave null if unspecifiedproperties - a string map of table propertiespublic Transaction newCreateTableTransaction(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
CatalognewCreateTableTransaction in interface Catalogidentifier - a table identifierschema - a schemaspec - a partition speclocation - a location for the table; leave null if unspecifiedproperties - a string map of table propertiesTransaction to create the tablepublic Transaction newReplaceTableTransaction(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties, boolean orCreate)
CatalognewReplaceTableTransaction in interface Catalogidentifier - a table identifierschema - a schemaspec - a partition speclocation - a location for the table; leave null if unspecifiedproperties - a string map of table propertiesorCreate - whether to create the table if not existsTransaction to replace the tablepublic Table loadTable(TableIdentifier identifier)
Catalogprotected boolean isValidIdentifier(TableIdentifier tableIdentifier)
public java.lang.String toString()
toString in class java.lang.Objectprotected abstract java.lang.String name()
protected abstract TableOperations newTableOps(TableIdentifier tableIdentifier)
protected abstract java.lang.String defaultWarehouseLocation(TableIdentifier tableIdentifier)
protected static void dropTableData(FileIO io, TableMetadata metadata)
This should be called by dropTable implementations to clean up table files once the table has been dropped in the metastore.
io - a FileIO to use for deletesmetadata - the last valid TableMetadata instance for a dropped table.