Class LogSegment

Object
io.delta.kernel.internal.snapshot.LogSegment

public class LogSegment extends Object
  • Field Details

    • logPath

      public final Path logPath
    • version

      public final long version
    • deltas

      public final List<FileStatus> deltas
    • checkpoints

      public final List<FileStatus> checkpoints
    • checkpointVersionOpt

      public final Optional<Long> checkpointVersionOpt
    • lastCommitTimestamp

      public final long lastCommitTimestamp
  • Constructor Details

    • LogSegment

      public LogSegment(Path logPath, long version, List<FileStatus> deltas, List<FileStatus> checkpoints, Optional<Long> checkpointVersionOpt, long lastCommitTimestamp)
      Provides information around which files in the transaction log need to be read to create the given version of the log.
      Parameters:
      logPath - The path to the _delta_log directory
      version - The Snapshot version to generate
      deltas - The delta commit files (.json) to read
      checkpoints - The checkpoint file(s) to read
      checkpointVersionOpt - The checkpoint version used to start replay
      lastCommitTimestamp - The "unadjusted" timestamp of the last commit within this segment. By unadjusted, we mean that the commit timestamps may not necessarily be monotonically increasing for the commits within this segment.
  • Method Details

    • empty

      public static LogSegment empty(Path logPath)
    • allLogFilesUnsorted

      public List<FileStatus> allLogFilesUnsorted()
      Returns:
      all deltas (.json) and checkpoint (.checkpoint.parquet) files in this LogSegment, with no ordering guarantees.
    • allLogFilesReversed

      public List<FileStatus> allLogFilesReversed()
      Returns:
      all deltas (.json) and checkpoint (.checkpoint.parquet) files in this LogSegment, sorted in reverse (00012.json, 00011.json, 00010.checkpoint.parquet) order.