Package org.apache.iceberg
Class BaseMetastoreCatalog
- java.lang.Object
-
- org.apache.iceberg.BaseMetastoreCatalog
-
- All Implemented Interfaces:
Catalog
- Direct Known Subclasses:
HadoopCatalog
,HiveCatalog
public abstract class BaseMetastoreCatalog extends java.lang.Object implements Catalog
-
-
Constructor Summary
Constructors Constructor Description BaseMetastoreCatalog()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.catalog.Catalog
createTable, createTable, createTable, dropTable, dropTable, listTables, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, renameTable, tableExists
-
-
-
-
Method Detail
-
createTable
public Table createTable(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:Catalog
Create a table.- Specified by:
createTable
in interfaceCatalog
- Parameters:
identifier
- a table identifierschema
- a schemaspec
- a partition speclocation
- a location for the table; leave null if unspecifiedproperties
- a string map of table properties- Returns:
- a Table instance
-
newCreateTableTransaction
public Transaction newCreateTableTransaction(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:Catalog
Start a transaction to create a table.- Specified by:
newCreateTableTransaction
in interfaceCatalog
- Parameters:
identifier
- a table identifierschema
- a schemaspec
- a partition speclocation
- a location for the table; leave null if unspecifiedproperties
- a string map of table properties- Returns:
- a
Transaction
to create the table
-
newReplaceTableTransaction
public Transaction newReplaceTableTransaction(TableIdentifier identifier, Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties, boolean orCreate)
Description copied from interface:Catalog
Start a transaction to replace a table.- Specified by:
newReplaceTableTransaction
in interfaceCatalog
- Parameters:
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 exists- Returns:
- a
Transaction
to replace the table
-
loadTable
public Table loadTable(TableIdentifier identifier)
Description copied from interface:Catalog
Load a table.
-
isValidIdentifier
protected boolean isValidIdentifier(TableIdentifier tableIdentifier)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
name
protected abstract java.lang.String name()
-
newTableOps
protected abstract TableOperations newTableOps(TableIdentifier tableIdentifier)
-
defaultWarehouseLocation
protected abstract java.lang.String defaultWarehouseLocation(TableIdentifier tableIdentifier)
-
dropTableData
protected static void dropTableData(FileIO io, TableMetadata metadata)
Drops all data and metadata files referenced by TableMetadata.This should be called by dropTable implementations to clean up table files once the table has been dropped in the metastore.
- Parameters:
io
- a FileIO to use for deletesmetadata
- the last valid TableMetadata instance for a dropped table.
-
fullTableName
protected static java.lang.String fullTableName(java.lang.String catalogName, TableIdentifier identifier)
-
-