Class ProtocolMetadataLogReplay

Object
io.delta.kernel.internal.replay.ProtocolMetadataLogReplay

public class ProtocolMetadataLogReplay extends Object
Static utility class for loading Protocol and Metadata from Delta log files.
  • Field Details

    • PROTOCOL_METADATA_READ_SCHEMA

      public static final StructType PROTOCOL_METADATA_READ_SCHEMA
      Read schema when searching for the latest Protocol and Metadata.
  • Constructor Details

    • ProtocolMetadataLogReplay

      public ProtocolMetadataLogReplay()
  • Method Details

    • loadProtocolAndMetadata

      public static ProtocolMetadataLogReplay.Result loadProtocolAndMetadata(Engine engine, Path dataPath, LogSegment logSegment, Lazy<Optional<CRCInfo>> lazyCrcInfo, SnapshotMetrics snapshotMetrics)
      Loads the latest Protocol and Metadata from the log files in the given LogSegment.

      Uses the provided lazy CRC loader to bound how many delta files it reads, and to ensure we only read the CRC file if needed.

      We read delta files in reverse order (newest first) searching for the latest Protocol and Metadata. When we reach the version just before (greater than) the CRC file version (if present), we lazily load the CRC file to fill in any missing Protocol or Metadata, avoiding reading older delta files.

      Also validates that the Kernel can read the table at the loaded protocol version.