Class IcebergCatalog.BasePolarisTableOperations

java.lang.Object
org.apache.polaris.service.catalog.iceberg.IcebergCatalog.BasePolarisTableOperations
All Implemented Interfaces:
org.apache.iceberg.TableOperations
Enclosing class:
IcebergCatalog

public class IcebergCatalog.BasePolarisTableOperations extends Object implements org.apache.iceberg.TableOperations
An implementation of TableOperations that integrates with IcebergCatalog. Much of this code was originally copied from BaseMetastoreTableOperations. CODE_COPIED_TO_POLARIS From Apache Iceberg Version: 1.8
  • Field Details

    • METADATA_FOLDER_NAME

      protected static final String METADATA_FOLDER_NAME
      See Also:
    • currentMetadata

      protected org.apache.iceberg.TableMetadata currentMetadata
    • currentMetadataLocation

      protected String currentMetadataLocation
    • shouldRefresh

      protected boolean shouldRefresh
    • version

      protected int version
  • Method Details

    • current

      public org.apache.iceberg.TableMetadata current()
      Specified by:
      current in interface org.apache.iceberg.TableOperations
    • refresh

      public org.apache.iceberg.TableMetadata refresh()
      Specified by:
      refresh in interface org.apache.iceberg.TableOperations
    • commit

      public void commit(org.apache.iceberg.TableMetadata base, org.apache.iceberg.TableMetadata metadata)
      Specified by:
      commit in interface org.apache.iceberg.TableOperations
    • io

      public org.apache.iceberg.io.FileIO io()
      Specified by:
      io in interface org.apache.iceberg.TableOperations
    • metadataFileLocation

      public String metadataFileLocation(String filename)
      Specified by:
      metadataFileLocation in interface org.apache.iceberg.TableOperations
    • locationProvider

      public org.apache.iceberg.io.LocationProvider locationProvider()
      Specified by:
      locationProvider in interface org.apache.iceberg.TableOperations
    • doRefresh

      public void doRefresh()
    • doCommit

      public void doCommit(org.apache.iceberg.TableMetadata base, org.apache.iceberg.TableMetadata metadata)
    • temp

      public org.apache.iceberg.TableOperations temp(org.apache.iceberg.TableMetadata uncommittedMetadata)
      Specified by:
      temp in interface org.apache.iceberg.TableOperations
    • writeNewMetadataIfRequired

      protected String writeNewMetadataIfRequired(boolean newTable, org.apache.iceberg.TableMetadata metadata)
    • writeNewMetadata

      protected String writeNewMetadata(org.apache.iceberg.TableMetadata metadata, int newVersion)
    • requestRefresh

      protected void requestRefresh()
    • disableRefresh

      protected void disableRefresh()
    • parseVersion

      protected int parseVersion(String metadataLocation)
      Parse the version from table/view metadata file name.
      Parameters:
      metadataLocation - table/view metadata file location
      Returns:
      version of the table/view metadata file in success case and -1 if the version is not parsable (as a sign that the metadata is not part of this catalog)
    • refreshFromMetadataLocation

      protected void refreshFromMetadataLocation(String newLocation, Predicate<Exception> shouldRetry, int numRetries, Function<String,org.apache.iceberg.TableMetadata> metadataLoader)