Class CheckpointCompactor


  • public class CheckpointCompactor
    extends Object
    This compactor implementation is aware of the checkpoints in the repository. It uses this information to further optimise the compaction result by
    • Rebasing the checkpoints and subsequently the root on top of each other in chronological order. This results minimises the deltas that need to be processed and stored.
    • Caching the compacted checkpoints and root states for deduplication should the same checkpoint or root state occur again in a later compaction retry cycle.
    • Constructor Detail

      • CheckpointCompactor

        public CheckpointCompactor​(@NotNull
                                   @NotNull org.apache.jackrabbit.oak.spi.gc.GCMonitor gcListener,
                                   @NotNull
                                   @NotNull SegmentReader reader,
                                   @NotNull
                                   @NotNull SegmentWriter writer,
                                   @Nullable
                                   @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
                                   @NotNull
                                   @NotNull GCNodeWriteMonitor compactionMonitor)
        Create a new instance based on the passed arguments.
        Parameters:
        reader - segment reader used to read from the segments
        writer - segment writer used to serialise to segments
        blobStore - the blob store or null if none
        compactionMonitor - notification call back for each compacted nodes, properties, and binaries
    • Method Detail

      • compact

        @Nullable
        public @Nullable SegmentNodeState compact​(@NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState base,
                                                  @NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState uncompacted,
                                                  @NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState onto,
                                                  Canceller canceller)
                                           throws IOException
        Compact uncompacted on top of an optional base.
        Parameters:
        base - the base state to compact against
        uncompacted - the uncompacted state to compact
        onto - the state onto which to compact the change between base and uncompacted
        Returns:
        compacted clone of uncompacted or null if cancelled.
        Throws:
        IOException