Class AbstractTwoPhaseCompactor<T>

java.lang.Object
org.apache.pulsar.compaction.Compactor
org.apache.pulsar.compaction.AbstractTwoPhaseCompactor<T>
Direct Known Subclasses:
EventTimeOrderCompactor, PublishingOrderCompactor

public abstract class AbstractTwoPhaseCompactor<T> extends Compactor
Compaction will go through the topic in two passes. The first pass selects latest offset for each key in the topic. Then the second pass writes these values to a ledger.

The two passes are required to avoid holding the payloads of each of the latest values in memory, as the payload can be many orders of magnitude larger than a message id.