Class LilyPadSnapshotBuilder
java.lang.Object
com.linkedin.venice.spark.consistency.LilyPadSnapshotBuilder
Builds a
LilyPadUtils.Snapshot from a PubSub partition split by reading records
through a PubSubSplitIterator and wrapping positions in ComparablePubSubPosition.
This class is the bridge between the PubSub infrastructure and the generic lily-pad algorithm
in LilyPadUtils. It is the only class that depends on PubSub types for snapshot construction.
-
Method Summary
Modifier and TypeMethodDescriptionbuildSnapshot(PubSubSplitIterator iterator, TopicManager topicManager, PubSubPositionDeserializer pubSubPositionDeserializer, int numberOfRegions) Iterates over a pre-builtPubSubSplitIteratorand returns a per-key history of PUT and DELETE records in the order they appeared in the VT partition.
-
Method Details
-
buildSnapshot
public static LilyPadUtils.Snapshot<ComparablePubSubPosition> buildSnapshot(PubSubSplitIterator iterator, TopicManager topicManager, PubSubPositionDeserializer pubSubPositionDeserializer, int numberOfRegions) Iterates over a pre-builtPubSubSplitIteratorand returns a per-key history of PUT and DELETE records in the order they appeared in the VT partition.The caller is responsible for constructing the iterator (including consumer creation and position discovery) and for closing it after this method returns.
The running high-watermark is computed in VT position order, so each
LilyPadUtils.KeyRecord'shighWatermarkreflects global RT progress up to that point.- Parameters:
iterator- a ready-to-read iterator over a single VT partition splittopicManager- TopicManager used for position comparison (max watermark)pubSubPositionDeserializer- deserializer for upstream PubSubPosition bytesnumberOfRegions- total number of regions in the AA topology (determines position vector size)- Returns:
LilyPadUtils.Snapshotcontaining the per-key record map and the final partition high-watermark
-