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 static java.lang.String |
fullTableName(java.lang.String catalogName,
TableIdentifier identifier) |
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, wait
createTable, createTable, createTable, dropTable, dropTable, listTables, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, renameTable, tableExists
public Table createTable(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
Catalog
createTable
in interface Catalog
identifier
- 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)
Catalog
newCreateTableTransaction
in interface Catalog
identifier
- 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)
Catalog
newReplaceTableTransaction
in interface Catalog
identifier
- 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)
Catalog
protected boolean isValidIdentifier(TableIdentifier tableIdentifier)
public java.lang.String toString()
toString
in class java.lang.Object
protected 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.protected static java.lang.String fullTableName(java.lang.String catalogName, TableIdentifier identifier)