Class StrategicTwoPhaseCompactor


public class StrategicTwoPhaseCompactor extends PublishingOrderCompactor
Compaction will go through the topic in two passes. The first pass selects valid message(defined in the TopicCompactionStrategy.isValid()) for each key in the topic. Then, the second pass writes these values to a ledger.

As the first pass caches the entire message(not just offset) for each key into a map, this compaction could be memory intensive if the message payload is large.