Class CommitRangeBuilderImpl

Object
io.delta.kernel.internal.commitrange.CommitRangeBuilderImpl
All Implemented Interfaces:
CommitRangeBuilder

public class CommitRangeBuilderImpl extends Object implements CommitRangeBuilder
An implementation of 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.

  • Constructor Details

  • Method Details

    • withEndBoundary

      public CommitRangeBuilderImpl withEndBoundary(CommitRangeBuilder.CommitBoundary endBoundary)
      Description copied from interface: CommitRangeBuilder
      Configures 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:
      withEndBoundary in interface CommitRangeBuilder
      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

      public CommitRangeBuilderImpl withLogData(List<ParsedLogData> logData)
      Description copied from interface: CommitRangeBuilder
      Provides 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:
      withLogData in interface CommitRangeBuilder
      Parameters:
      logData - the list of pre-parsed log data, must not be null
      Returns:
      this builder instance configured with the specified log data
    • withMaxCatalogVersion

      public CommitRangeBuilderImpl withMaxCatalogVersion(long version)
      Description copied from interface: CommitRangeBuilder
      Specifies 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:

      Specified by:
      withMaxCatalogVersion in interface CommitRangeBuilder
      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

      public CommitRange build(Engine engine)
      Description copied from interface: CommitRangeBuilder
      Builds and returns a CommitRange instance 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:
      build in interface CommitRangeBuilder
      Parameters:
      engine - the Engine to use for file system operations and log parsing
      Returns:
      a new CommitRange instance configured according to this builder's specifications