Class CommitRangeBuilderImpl
- All Implemented Interfaces:
CommitRangeBuilder
CommitRangeBuilder.
Note: The primary responsibility of this class is to take input, validate that input, and then
create a CommitRange instance with the specified configuration.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.delta.kernel.CommitRangeBuilder
CommitRangeBuilder.CommitBoundary -
Constructor Summary
ConstructorsConstructorDescriptionCommitRangeBuilderImpl(String unresolvedPath, CommitRangeBuilder.CommitBoundary startBoundary) -
Method Summary
Modifier and TypeMethodDescriptionBuilds and returns aCommitRangeinstance with the configured specifications.withEndBoundary(CommitRangeBuilder.CommitBoundary endBoundary) Configures the builder to end the commit range at a specific version or timestamp.withLogData(List<ParsedLogData> logData) Provides parsed log data to optimize the commit range construction.withMaxCatalogVersion(long version) Specifies the maximum table version known by the catalog.
-
Constructor Details
-
CommitRangeBuilderImpl
public CommitRangeBuilderImpl(String unresolvedPath, CommitRangeBuilder.CommitBoundary startBoundary)
-
-
Method Details
-
withEndBoundary
Description copied from interface:CommitRangeBuilderConfigures the builder to end the commit range at a specific version or timestamp.If not specified, the commit range will default to ending at the latest available version.
- Specified by:
withEndBoundaryin interfaceCommitRangeBuilder- Parameters:
endBoundary- the boundary specification for the end of the commit range, must not be null- Returns:
- this builder instance configured with the specified end boundary
-
withLogData
Description copied from interface:CommitRangeBuilderProvides parsed log data to optimize the commit range construction.Note: If no end boundary is provided via
CommitRangeBuilder.withEndBoundary(CommitBoundary), or a timestamp-based end boundary is provided, the provided log data must include all available ratified commits. If a version-based end boundary is provided, the log data must include commits up to at least the end version (i.e., the tail of the log data must have a version greater than or equal to the end version).- Specified by:
withLogDatain interfaceCommitRangeBuilder- Parameters:
logData- the list of pre-parsed log data, must not be null- Returns:
- this builder instance configured with the specified log data
-
withMaxCatalogVersion
Description copied from interface:CommitRangeBuilderSpecifies the maximum table version known by the catalog.This method is used by catalog implementations for catalog-managed Delta tables to indicate the latest ratified version of the table. This ensures that any commit range operations respect the catalog's view of the table state.
Important: This method is required for catalog-managed tables and must not be used for file-system managed tables.
When specified, the following additional constraints are enforced:
- When the provided startBoundary is version-based, the start version must be less than or equal to the max catalog version.
- If
CommitRangeBuilder.withEndBoundary(CommitBoundary)is used with a version, the requested version must be less than or equal to the max catalog version. - If the provided startBoundary is timestamp-based, or
CommitRangeBuilder.withEndBoundary(CommitBoundary)is used with a timestamp, the provided latest snapshot must have a version equal to the max catalog version. - If
CommitRangeBuilder.withLogData(List)is provided and no end boundary is specified (resolving to latest), the log data must end with the max catalog version.
- Specified by:
withMaxCatalogVersionin interfaceCommitRangeBuilder- Parameters:
version- the maximum table version known by the catalog (must be>= 0)- Returns:
- a new builder instance with the specified max catalog version
-
build
Description copied from interface:CommitRangeBuilderBuilds and returns aCommitRangeinstance with the configured specifications.This method validates the builder configuration and constructs the commit range by resolving version numbers from timestamps if necessary and determining the actual commit files that fall within the specified range.
- Specified by:
buildin interfaceCommitRangeBuilder- Parameters:
engine- theEngineto use for file system operations and log parsing- Returns:
- a new
CommitRangeinstance configured according to this builder's specifications
-