Class ClassicCompactor

  • All Implemented Interfaces:
    Compactor

    public class ClassicCompactor
    extends java.lang.Object
    implements Compactor
    Instances of this class can be used to compact a node state. I.e. to create a clone of a given node state without value sharing except for binaries. Binaries that are stored in a list of bulk segments will still value share the bulk segments (but not the list records). A node can either be compacted on its own or alternatively the difference between two nodes can be compacted on top of an already compacted node.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassicCompactor​(@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 before, @NotNull org.apache.jackrabbit.oak.spi.state.NodeState after, @NotNull org.apache.jackrabbit.oak.spi.state.NodeState onto, Canceller canceller)
      compact the differences between after and before on top of ont.
      @Nullable SegmentNodeState compact​(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState state, Canceller canceller)
      Compact a given state
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassicCompactor

        public ClassicCompactor​(@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 state,
                                                  Canceller canceller)
                                           throws java.io.IOException
        Compact a given state
        Parameters:
        state - the node state to compact
        Returns:
        the compacted node state or null if cancelled.
        Throws:
        java.io.IOException
      • compact

        @Nullable
        public @Nullable SegmentNodeState compact​(@NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState before,
                                                  @NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState after,
                                                  @NotNull
                                                  @NotNull org.apache.jackrabbit.oak.spi.state.NodeState onto,
                                                  Canceller canceller)
                                           throws java.io.IOException
        compact the differences between after and before on top of ont.
        Specified by:
        compact in interface Compactor
        Parameters:
        before - the node state to diff against from after
        after - the node state diffed against before
        onto - the node state compacted onto
        Returns:
        the compacted node state or null if cancelled.
        Throws:
        java.io.IOException