Class CommitMetadata

Object
io.delta.kernel.commit.CommitMetadata

@Experimental public class CommitMetadata extends Object
Contains all information (excluding the iterator of finalized actions) required to commit changes to a Delta table.
  • Constructor Details

  • Method Details

    • getVersion

      public long getVersion()
      The version of the Delta table this commit is targeting.
    • getDeltaLogDirPath

      public String getDeltaLogDirPath()
      The path to the Delta log directory, located at <table_root>/_delta_log.
    • getCommitInfo

      public CommitInfo getCommitInfo()
      The CommitInfo that is being written as part of this commit.
    • getCommitDomainMetadatas

      public List<DomainMetadata> getCommitDomainMetadatas()
      The DomainMetadatas that are being written as part of this commit. Includes those that are being explicitly added and those that are being explicitly removed (tombstoned).

      Does not include the domain metadatas that already exist in the transaction's read snapshot, if any.

    • getCommitterProperties

      public Supplier<Map<String,String>> getCommitterProperties()
      Returns custom properties provided by the connector to be passed through to the committer. These properties are not inspected by Kernel and are used for catalog-specific functionality.
    • getReadProtocolOpt

      public Optional<Protocol> getReadProtocolOpt()
      The Protocol that was read at the beginning of the commit. Empty if a new table is being created.
    • getReadMetadataOpt

      public Optional<Metadata> getReadMetadataOpt()
      The Metadata that was read at the beginning of the commit. Empty if a new table is being created.
    • getNewProtocolOpt

      public Optional<Protocol> getNewProtocolOpt()
      The Protocol that is being written as part of this commit. Empty if the protocol is not being changed.
    • getNewMetadataOpt

      public Optional<Metadata> getNewMetadataOpt()
      The Metadata that is being written as part of this commit. Empty if the metadata is not being changed.
    • getMaxKnownPublishedDeltaVersion

      public Optional<Long> getMaxKnownPublishedDeltaVersion()
      Returns the maximum known published delta version at commit time.

      This is a best-effort API that returns what was actually seen during Snapshot and Transaction construction, not the authoritative maximum published delta version in the log.

      Optional.empty() means "we don't know" - not necessarily that no deltas have been published.

      Optional.of(-1) means it is known that there are no published deltas (e.g., during CREATE)

      Returns:
      the maximum known published delta version, or empty if unknown
    • getEffectiveProtocol

      public Protocol getEffectiveProtocol()
      Returns the effective Protocol that will be in place after this commit. If a new protocol is being written as part of this commit, returns the new protocol. Otherwise, returns the protocol that was read at the beginning of the commit.
    • getEffectiveMetadata

      public Metadata getEffectiveMetadata()
      Returns the effective Metadata that will be in place after this commit. If new metadata is being written as part of this commit, returns the new metadata. Otherwise, returns the metadata that was read at the beginning of the commit.
    • getCommitType

      public CommitMetadata.CommitType getCommitType()
      Determines the type of commit based on whether this is a table creation and the catalog-managed status of the table before and after the commit.
    • getPublishedDeltaFilePath

      public String getPublishedDeltaFilePath()
      Returns the corresponding published Delta log file path for this commit, which is in the form of <table_path>/_delta_log/0000000000000000000<version>.json.

      Usages:

      • Filesystem-managed committers must write to this file path.
      • Catalog-managed committers must publish to this file path, if/when they so choose.
    • generateNewStagedCommitFilePath

      public String generateNewStagedCommitFilePath()
      Returns a new staged commit file path with a unique UUID for this commit. Each invocation returns a new, unique value, in the form of <table_path>/_delta_log/_staged_commits/0000000000000000000<version>.<uuid>.json

      Catalog-managed committers may use this path to write new staged commits.