Package org.apache.iceberg
Class CachingCatalog
java.lang.Object
org.apache.iceberg.CachingCatalog
- All Implemented Interfaces:
- Catalog
Class that wraps an Iceberg Catalog to cache tables.
 
See CatalogProperties.CACHE_EXPIRATION_INTERVAL_MS for more details regarding special
 values for expirationIntervalMillis.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.iceberg.catalog.CatalogCatalog.TableBuilder
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final longprotected final com.github.benmanes.caffeine.cache.Cache<TableIdentifier, Table> 
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCachingCatalog(Catalog catalog, boolean caseSensitive, long expirationIntervalMillis, com.github.benmanes.caffeine.cache.Ticker ticker) 
- 
Method SummaryModifier and TypeMethodDescriptionbuildTable(TableIdentifier identifier, Schema schema) Instantiate a builder to either create a table or start a create/replace transaction.booleandropTable(TableIdentifier ident, boolean purge) Drop a table; optionally delete data and metadata files.voidinvalidateTable(TableIdentifier ident) Invalidate cached table metadata from current catalog.listTables(Namespace namespace) Return all the identifiers under this namespace.loadTable(TableIdentifier ident) Load a table.name()Return the name for this catalog.registerTable(TableIdentifier identifier, String metadataFileLocation) Register a table with the catalog if it does not exist.voidrenameTable(TableIdentifier from, TableIdentifier to) Rename a table.static Catalogstatic Catalogstatic CatalogMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.catalog.CatalogcreateTable, createTable, createTable, createTable, dropTable, initialize, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, tableExists
- 
Field Details- 
expirationIntervalMillisprotected final long expirationIntervalMillis
- 
tableCache
 
- 
- 
Constructor Details- 
CachingCatalogprotected CachingCatalog(Catalog catalog, boolean caseSensitive, long expirationIntervalMillis, com.github.benmanes.caffeine.cache.Ticker ticker) 
 
- 
- 
Method Details- 
wrap
- 
wrap
- 
wrap
- 
nameDescription copied from interface:CatalogReturn the name for this catalog.
- 
listTablesDescription copied from interface:CatalogReturn all the identifiers under this namespace.- Specified by:
- listTablesin interface- Catalog
- Parameters:
- namespace- a namespace
- Returns:
- a list of identifiers for tables
 
- 
loadTableDescription copied from interface:CatalogLoad a table.
- 
dropTableDescription copied from interface:CatalogDrop a table; optionally delete data and metadata files.If purge is set to true the implementation should delete all data and metadata files. 
- 
renameTableDescription copied from interface:CatalogRename a table.- Specified by:
- renameTablein interface- Catalog
- Parameters:
- from- identifier of the table to rename
- to- new table name
 
- 
invalidateTableDescription copied from interface:CatalogInvalidate cached table metadata from current catalog.If the table is already loaded or cached, drop cached data. If the table does not exist or is not cached, do nothing. - Specified by:
- invalidateTablein interface- Catalog
- Parameters:
- ident- a table identifier
 
- 
registerTableDescription copied from interface:CatalogRegister a table with the catalog if it does not exist.- Specified by:
- registerTablein interface- Catalog
- Parameters:
- identifier- a table identifier
- metadataFileLocation- the location of a metadata file
- Returns:
- a Table instance
 
- 
buildTableDescription copied from interface:CatalogInstantiate a builder to either create a table or start a create/replace transaction.- Specified by:
- buildTablein interface- Catalog
- Parameters:
- identifier- a table identifier
- schema- a schema
- Returns:
- the builder to create a table or start a create/replace transaction
 
 
-