Class CheckpointCompactor

  • All Implemented Interfaces:
    Compactor

    public class CheckpointCompactor
    extends java.lang.Object
    implements Compactor
    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 Summary

      Constructors 
      Constructor Description
      CheckpointCompactor​(@NotNull org.apache.jackrabbit.oak.spi.gc.GCMonitor gcListener, @NotNull SegmentReader reader, @NotNull SegmentWriter writer, @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, @NotNull GCNodeWriteMonitor compactionMonitor)
      Create a new instance based on the passed arguments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable SegmentNodeState compact​(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState base, @NotNull org.apache.jackrabbit.oak.spi.state.NodeState uncompacted, @NotNull org.apache.jackrabbit.oak.spi.state.NodeState onto, Canceller canceller)
      Compact uncompacted on top of an optional base.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        gcListener - listener receiving notifications about the garbage collection process
        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 java.io.IOException
        Compact uncompacted on top of an optional base.
        Specified by:
        compact in interface Compactor
        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:
        java.io.IOException