Class BaseMetastoreOperations

java.lang.Object
org.apache.iceberg.BaseMetastoreOperations
Direct Known Subclasses:
BaseMetastoreTableOperations, BaseViewOperations

public abstract class BaseMetastoreOperations extends Object
  • Constructor Details

    • BaseMetastoreOperations

      public BaseMetastoreOperations()
  • Method Details

    • checkCommitStatus

      protected BaseMetastoreOperations.CommitStatus checkCommitStatus(String tableOrViewName, String newMetadataLocation, Map<String,String> properties, Supplier<Boolean> commitStatusSupplier)
      Attempt to load the content and see if any current or past metadata location matches the one we were attempting to set. This is used as a last resort when we are dealing with exceptions that may indicate the commit has failed but don't have proof that this is the case. Note that all the previous locations must also be searched on the chance that a second committer was able to successfully commit on top of our commit. When the newMetadataLocation is not in the history or the commitStatusSupplier fails repeatedly the method returns BaseMetastoreOperations.CommitStatus.UNKNOWN, because possible pending retries might still commit the change.
      Parameters:
      tableOrViewName - full name of the Table/View
      newMetadataLocation - the path of the new commit file
      properties - properties for retry
      commitStatusSupplier - check if the latest metadata presents or not using metadata location for table.
      Returns:
      Commit Status of Success or Unknown
    • checkCommitStatusStrict

      protected BaseMetastoreOperations.CommitStatus checkCommitStatusStrict(String tableOrViewName, String newMetadataLocation, Map<String,String> properties, Supplier<Boolean> commitStatusSupplier)
      Attempt to load the content and see if any current or past metadata location matches the one we were attempting to set. This is used as a last resort when we are dealing with exceptions that may indicate the commit has failed and don't have proof that this is the case, but we can be sure that no retry attempts for the commit will be successful later. Note that all the previous locations must also be searched on the chance that a second committer was able to successfully commit on top of our commit. When the newMetadataLocation is not in the history the method returns BaseMetastoreOperations.CommitStatus.FAILURE, when the commitStatusSupplier fails repeatedly the method returns BaseMetastoreOperations.CommitStatus.UNKNOWN.
      Parameters:
      tableOrViewName - full name of the Table/View
      newMetadataLocation - the path of the new commit file
      properties - properties for retry
      commitStatusSupplier - check if the latest metadata presents or not using metadata location for table.
      Returns:
      Commit Status of Success, Failure or Unknown