Class IcebergCatalog
java.lang.Object
org.apache.iceberg.BaseMetastoreCatalog
org.apache.iceberg.view.BaseMetastoreViewCatalog
org.apache.polaris.service.catalog.iceberg.IcebergCatalog
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.iceberg.catalog.Catalog,org.apache.iceberg.catalog.SupportsNamespaces,org.apache.iceberg.catalog.ViewCatalog,SupportsCredentialDelegation,SupportsNotifications
public class IcebergCatalog
extends org.apache.iceberg.view.BaseMetastoreViewCatalog
implements org.apache.iceberg.catalog.SupportsNamespaces, SupportsNotifications, Closeable, SupportsCredentialDelegation
Defines the relationship between PolarisEntities and Iceberg's business logic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAn implementation ofTableOperationsthat integrates withIcebergCatalog.Nested classes/interfaces inherited from class org.apache.iceberg.view.BaseMetastoreViewCatalog
org.apache.iceberg.view.BaseMetastoreViewCatalog.BaseMetastoreViewCatalogTableBuilder, org.apache.iceberg.view.BaseMetastoreViewCatalog.BaseViewBuilderNested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreCatalog
org.apache.iceberg.BaseMetastoreCatalog.BaseMetastoreCatalogTableBuilderNested classes/interfaces inherited from interface org.apache.iceberg.catalog.Catalog
org.apache.iceberg.catalog.Catalog.TableBuilder -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionIcebergCatalog(org.apache.polaris.core.persistence.PolarisEntityManager entityManager, org.apache.polaris.core.persistence.PolarisMetaStoreManager metaStoreManager, org.apache.polaris.core.context.CallContext callContext, org.apache.polaris.core.persistence.resolver.PolarisResolutionManifestCatalogView resolvedEntityView, jakarta.ws.rs.core.SecurityContext securityContext, TaskExecutor taskExecutor, FileIOFactory fileIOFactory, PolarisEventListener polarisEventListener) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.iceberg.catalog.Catalog.TableBuilderbuildTable(org.apache.iceberg.catalog.TableIdentifier identifier, org.apache.iceberg.Schema schema) org.apache.iceberg.view.ViewBuilderbuildView(org.apache.iceberg.catalog.TableIdentifier identifier) voidclose()voidcreateNamespace(org.apache.iceberg.catalog.Namespace namespace) voidcreateNamespace(org.apache.iceberg.catalog.Namespace namespace, Map<String, String> metadata) protected StringdefaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) booleandropNamespace(org.apache.iceberg.catalog.Namespace namespace) booleandropTable(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, boolean purge) booleandropView(org.apache.iceberg.catalog.TableIdentifier identifier) org.apache.polaris.core.storage.AccessConfiggetAccessConfig(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, org.apache.iceberg.TableMetadata tableMetadata, Set<org.apache.polaris.core.storage.PolarisStorageActions> storageActions) voidinitialize(String name, Map<String, String> properties) List<org.apache.iceberg.catalog.Namespace> List<org.apache.iceberg.catalog.Namespace> listNamespaces(org.apache.iceberg.catalog.Namespace namespace) org.apache.polaris.core.persistence.pagination.Page<org.apache.iceberg.catalog.Namespace> listNamespaces(org.apache.iceberg.catalog.Namespace namespace, String pageToken, Integer pageSize) List<org.apache.iceberg.catalog.TableIdentifier> listTables(org.apache.iceberg.catalog.Namespace namespace) org.apache.polaris.core.persistence.pagination.Page<org.apache.iceberg.catalog.TableIdentifier> listTables(org.apache.iceberg.catalog.Namespace namespace, String pageToken, Integer pageSize) List<org.apache.iceberg.catalog.TableIdentifier> listViews(org.apache.iceberg.catalog.Namespace namespace) org.apache.polaris.core.persistence.pagination.Page<org.apache.iceberg.catalog.TableIdentifier> protected org.apache.iceberg.io.FileIOloadFileIO(String ioImpl, Map<String, String> properties) Load FileIO with provided impl and propertiesloadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace) name()booleannamespaceExists(org.apache.iceberg.catalog.Namespace namespace) protected org.apache.iceberg.TableOperationsnewTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) org.apache.iceberg.TableOperationsnewTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, boolean makeMetadataCurrentOnCommit) protected org.apache.iceberg.view.ViewOperationsnewViewOps(org.apache.iceberg.catalog.TableIdentifier identifier) org.apache.iceberg.TableregisterTable(org.apache.iceberg.catalog.TableIdentifier identifier, String metadataFileLocation) booleanremoveProperties(org.apache.iceberg.catalog.Namespace namespace, Set<String> properties) voidrenameTable(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to) voidrenameView(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to) booleansendNotification(org.apache.iceberg.catalog.TableIdentifier identifier, org.apache.polaris.service.types.NotificationRequest notificationRequest) voidsetCatalogFileIo(org.apache.iceberg.io.FileIO fileIO) voidsetFileIOFactory(FileIOFactory newFactory) voidsetMetaStoreManager(org.apache.polaris.core.persistence.PolarisMetaStoreManager newMetaStoreManager) booleansetProperties(org.apache.iceberg.catalog.Namespace namespace, Map<String, String> properties) transformTableLikeLocation(String specifiedTableLikeLocation) Based on configuration settings, for callsites that need to handle potentially setting a new base location for a TableLike entity, produces the transformed location if applicable, or else the unaltered specified location.Methods inherited from class org.apache.iceberg.view.BaseMetastoreViewCatalog
loadViewMethods inherited from class org.apache.iceberg.BaseMetastoreCatalog
fullTableName, isValidIdentifier, isValidMetadataIdentifier, loadTable, metricsReporter, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.iceberg.catalog.Catalog
createTable, createTable, createTable, createTable, dropTable, invalidateTable, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, tableExistsMethods inherited from interface org.apache.iceberg.catalog.ViewCatalog
invalidateView, viewExists
-
Field Details
-
SHOULD_RETRY_REFRESH_PREDICATE
-
-
Constructor Details
-
IcebergCatalog
public IcebergCatalog(org.apache.polaris.core.persistence.PolarisEntityManager entityManager, org.apache.polaris.core.persistence.PolarisMetaStoreManager metaStoreManager, org.apache.polaris.core.context.CallContext callContext, org.apache.polaris.core.persistence.resolver.PolarisResolutionManifestCatalogView resolvedEntityView, jakarta.ws.rs.core.SecurityContext securityContext, TaskExecutor taskExecutor, FileIOFactory fileIOFactory, PolarisEventListener polarisEventListener) - Parameters:
entityManager- provides handle to underlying PolarisMetaStoreManager with which to perform mutations on entities.callContext- the current CallContextresolvedEntityView- accessor to resolved entity paths that have been pre-vetted to ensure this catalog instance only interacts with authorized resolved paths.taskExecutor- Executor we use to register cleanup task handlers
-
-
Method Details
-
name
- Specified by:
namein interfaceorg.apache.iceberg.catalog.Catalog- Specified by:
namein interfaceorg.apache.iceberg.catalog.ViewCatalog- Overrides:
namein classorg.apache.iceberg.view.BaseMetastoreViewCatalog
-
setCatalogFileIo
public void setCatalogFileIo(org.apache.iceberg.io.FileIO fileIO) -
initialize
- Specified by:
initializein interfaceorg.apache.iceberg.catalog.Catalog- Specified by:
initializein interfaceorg.apache.iceberg.catalog.ViewCatalog- Overrides:
initializein classorg.apache.iceberg.view.BaseMetastoreViewCatalog
-
setMetaStoreManager
public void setMetaStoreManager(org.apache.polaris.core.persistence.PolarisMetaStoreManager newMetaStoreManager) -
properties
- Overrides:
propertiesin classorg.apache.iceberg.BaseMetastoreCatalog
-
registerTable
public org.apache.iceberg.Table registerTable(org.apache.iceberg.catalog.TableIdentifier identifier, String metadataFileLocation) - Specified by:
registerTablein interfaceorg.apache.iceberg.catalog.Catalog- Overrides:
registerTablein classorg.apache.iceberg.BaseMetastoreCatalog
-
buildTable
public org.apache.iceberg.catalog.Catalog.TableBuilder buildTable(org.apache.iceberg.catalog.TableIdentifier identifier, org.apache.iceberg.Schema schema) - Specified by:
buildTablein interfaceorg.apache.iceberg.catalog.Catalog- Overrides:
buildTablein classorg.apache.iceberg.view.BaseMetastoreViewCatalog
-
buildView
public org.apache.iceberg.view.ViewBuilder buildView(org.apache.iceberg.catalog.TableIdentifier identifier) - Specified by:
buildViewin interfaceorg.apache.iceberg.catalog.ViewCatalog- Overrides:
buildViewin classorg.apache.iceberg.view.BaseMetastoreViewCatalog
-
newTableOps
public org.apache.iceberg.TableOperations newTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, boolean makeMetadataCurrentOnCommit) -
newTableOps
protected org.apache.iceberg.TableOperations newTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) - Specified by:
newTableOpsin classorg.apache.iceberg.BaseMetastoreCatalog
-
defaultWarehouseLocation
protected String defaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) - Specified by:
defaultWarehouseLocationin classorg.apache.iceberg.BaseMetastoreCatalog
-
dropTable
public boolean dropTable(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, boolean purge) - Specified by:
dropTablein interfaceorg.apache.iceberg.catalog.Catalog
-
listTables
public List<org.apache.iceberg.catalog.TableIdentifier> listTables(org.apache.iceberg.catalog.Namespace namespace) - Specified by:
listTablesin interfaceorg.apache.iceberg.catalog.Catalog
-
listTables
-
renameTable
public void renameTable(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to) - Specified by:
renameTablein interfaceorg.apache.iceberg.catalog.Catalog
-
createNamespace
public void createNamespace(org.apache.iceberg.catalog.Namespace namespace) - Specified by:
createNamespacein interfaceorg.apache.iceberg.catalog.SupportsNamespaces
-
createNamespace
public void createNamespace(org.apache.iceberg.catalog.Namespace namespace, Map<String, String> metadata) - Specified by:
createNamespacein interfaceorg.apache.iceberg.catalog.SupportsNamespaces
-
namespaceExists
public boolean namespaceExists(org.apache.iceberg.catalog.Namespace namespace) - Specified by:
namespaceExistsin interfaceorg.apache.iceberg.catalog.SupportsNamespaces
-
dropNamespace
public boolean dropNamespace(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NamespaceNotEmptyException - Specified by:
dropNamespacein interfaceorg.apache.iceberg.catalog.SupportsNamespaces- Throws:
org.apache.iceberg.exceptions.NamespaceNotEmptyException
-
setProperties
public boolean setProperties(org.apache.iceberg.catalog.Namespace namespace, Map<String, String> properties) throws org.apache.iceberg.exceptions.NoSuchNamespaceException- Specified by:
setPropertiesin interfaceorg.apache.iceberg.catalog.SupportsNamespaces- Throws:
org.apache.iceberg.exceptions.NoSuchNamespaceException
-
removeProperties
public boolean removeProperties(org.apache.iceberg.catalog.Namespace namespace, Set<String> properties) throws org.apache.iceberg.exceptions.NoSuchNamespaceException - Specified by:
removePropertiesin interfaceorg.apache.iceberg.catalog.SupportsNamespaces- Throws:
org.apache.iceberg.exceptions.NoSuchNamespaceException
-
loadNamespaceMetadata
public Map<String,String> loadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NoSuchNamespaceException - Specified by:
loadNamespaceMetadatain interfaceorg.apache.iceberg.catalog.SupportsNamespaces- Throws:
org.apache.iceberg.exceptions.NoSuchNamespaceException
-
listNamespaces
- Specified by:
listNamespacesin interfaceorg.apache.iceberg.catalog.SupportsNamespaces
-
listNamespaces
public List<org.apache.iceberg.catalog.Namespace> listNamespaces(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NoSuchNamespaceException - Specified by:
listNamespacesin interfaceorg.apache.iceberg.catalog.SupportsNamespaces- Throws:
org.apache.iceberg.exceptions.NoSuchNamespaceException
-
listNamespaces
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.iceberg.BaseMetastoreCatalog- Throws:
IOException
-
listViews
public List<org.apache.iceberg.catalog.TableIdentifier> listViews(org.apache.iceberg.catalog.Namespace namespace) - Specified by:
listViewsin interfaceorg.apache.iceberg.catalog.ViewCatalog
-
listViews
-
newViewOps
protected org.apache.iceberg.view.ViewOperations newViewOps(org.apache.iceberg.catalog.TableIdentifier identifier) - Specified by:
newViewOpsin classorg.apache.iceberg.view.BaseMetastoreViewCatalog
-
dropView
public boolean dropView(org.apache.iceberg.catalog.TableIdentifier identifier) - Specified by:
dropViewin interfaceorg.apache.iceberg.catalog.ViewCatalog
-
renameView
public void renameView(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to) - Specified by:
renameViewin interfaceorg.apache.iceberg.catalog.ViewCatalog
-
sendNotification
public boolean sendNotification(org.apache.iceberg.catalog.TableIdentifier identifier, org.apache.polaris.service.types.NotificationRequest notificationRequest) - Specified by:
sendNotificationin interfaceSupportsNotifications
-
getAccessConfig
public org.apache.polaris.core.storage.AccessConfig getAccessConfig(org.apache.iceberg.catalog.TableIdentifier tableIdentifier, org.apache.iceberg.TableMetadata tableMetadata, Set<org.apache.polaris.core.storage.PolarisStorageActions> storageActions) - Specified by:
getAccessConfigin interfaceSupportsCredentialDelegation
-
transformTableLikeLocation
Based on configuration settings, for callsites that need to handle potentially setting a new base location for a TableLike entity, produces the transformed location if applicable, or else the unaltered specified location. -
setFileIOFactory
-
loadFileIO
Load FileIO with provided impl and properties- Parameters:
ioImpl- full class name of a custom FileIO implementationproperties- used to initialize the FileIO implementation- Returns:
- FileIO object
-