Package io.delta.kernel.commit
Class CommitMetadata
Object
io.delta.kernel.commit.CommitMetadata
Contains all information (excluding the iterator of finalized actions) required to commit changes
to a Delta table.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the different types of commits based on filesystem-managed and catalog-managed state transitions. -
Constructor Summary
ConstructorsConstructorDescriptionCommitMetadata(long version, String logPath, CommitInfo commitInfo, List<DomainMetadata> commitDomainMetadatas, Supplier<Map<String, String>> committerProperties, Optional<Tuple2<Protocol, Metadata>> readPandMOpt, Optional<Protocol> newProtocolOpt, Optional<Metadata> newMetadataOpt, Optional<Long> maxKnownPublishedDeltaVersion) -
Method Summary
Modifier and TypeMethodDescriptionReturns a new staged commit file path with a unique UUID for this commit.TheDomainMetadatas that are being written as part of this commit.TheCommitInfothat is being written as part of this commit.Returns custom properties provided by the connector to be passed through to the committer.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.The path to the Delta log directory, located at<table_root>/_delta_log.Returns the effectiveMetadatathat will be in place after this commit.Returns the effectiveProtocolthat will be in place after this commit.Returns the maximum known published delta version at commit time.TheMetadatathat is being written as part of this commit.TheProtocolthat is being written as part of this commit.Returns the corresponding published Delta log file path for this commit, which is in the form of<table_path>/_delta_log/0000000000000000000<version>.json.TheMetadatathat was read at the beginning of the commit.TheProtocolthat was read at the beginning of the commit.longThe version of the Delta table this commit is targeting.
-
Constructor Details
-
CommitMetadata
public CommitMetadata(long version, String logPath, CommitInfo commitInfo, List<DomainMetadata> commitDomainMetadatas, Supplier<Map<String, String>> committerProperties, Optional<Tuple2<Protocol, Metadata>> readPandMOpt, Optional<Protocol> newProtocolOpt, Optional<Metadata> newMetadataOpt, Optional<Long> maxKnownPublishedDeltaVersion)
-
-
Method Details
-
getVersion
public long getVersion()The version of the Delta table this commit is targeting. -
getDeltaLogDirPath
The path to the Delta log directory, located at<table_root>/_delta_log. -
getCommitInfo
TheCommitInfothat is being written as part of this commit. -
getCommitDomainMetadatas
TheDomainMetadatas 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
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
TheProtocolthat was read at the beginning of the commit. Empty if a new table is being created. -
getReadMetadataOpt
TheMetadatathat was read at the beginning of the commit. Empty if a new table is being created. -
getNewProtocolOpt
TheProtocolthat is being written as part of this commit. Empty if the protocol is not being changed. -
getNewMetadataOpt
TheMetadatathat is being written as part of this commit. Empty if the metadata is not being changed. -
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
Returns the effectiveProtocolthat 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
Returns the effectiveMetadatathat 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
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
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
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>.jsonCatalog-managed committers may use this path to write new staged commits.
-