Class CheckpointCompactor
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.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 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)
Compactuncompacted
on top of an optionalbase
.
-
-
-
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 segmentswriter
- segment writer used to serialise to segmentsblobStore
- the blob store ornull
if nonecompactionMonitor
- 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
Compactuncompacted
on top of an optionalbase
.- Parameters:
base
- the base state to compact againstuncompacted
- the uncompacted state to compactonto
- the state onto which to compact the change betweenbase
anduncompacted
- Returns:
- compacted clone of
uncompacted
ornull
if cancelled. - Throws:
IOException
-
-