Package io.delta.kernel.internal.replay
Class ProtocolMetadataLogReplay
Object
io.delta.kernel.internal.replay.ProtocolMetadataLogReplay
Static utility class for loading Protocol and Metadata from Delta log files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult of loading Protocol and Metadata from a LogSegment. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StructTypeRead schema when searching for the latest Protocol and Metadata. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadProtocolAndMetadata(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.
-
Field Details
-
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.
-