Class ParallelCompactor
java.lang.Object
org.apache.jackrabbit.oak.segment.Compactor
org.apache.jackrabbit.oak.segment.CheckpointCompactor
org.apache.jackrabbit.oak.segment.ParallelCompactor
This compactor implementation leverages the tree structure of the repository for concurrent compaction.
It explores the tree breadth-first until the target node count (10000) is reached.
Every node at this depth will be an entry point for asynchronous compaction. After the exploration phase,
the main thread will collect these compaction results and write their parents' node state to disk.
-
Field Summary
Fields inherited from class org.apache.jackrabbit.oak.segment.CheckpointCompactor
compactor, gcListener
-
Constructor Summary
ConstructorsConstructorDescriptionParallelCompactor
(@NotNull GCMonitor gcListener, @NotNull CompactionWriter writer, @NotNull GCNodeWriteMonitor compactionMonitor, int nThreads) Create a new instance based on the passed arguments. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable CompactedNodeState
compactDownWithDelegate
(@NotNull NodeState before, @NotNull NodeState after, @NotNull Canceller hardCanceller, @NotNull Canceller softCanceller) Delegate compaction to another, usually simpler, implementation.protected @Nullable CompactedNodeState
compactWithDelegate
(@NotNull NodeState before, @NotNull NodeState after, @NotNull NodeState onto, @NotNull Canceller canceller) Methods inherited from class org.apache.jackrabbit.oak.segment.CheckpointCompactor
compact, compactDown
Methods inherited from class org.apache.jackrabbit.oak.segment.Compactor
compactDown, compactUp, compactUp
-
Constructor Details
-
ParallelCompactor
public ParallelCompactor(@NotNull @NotNull GCMonitor gcListener, @NotNull @NotNull CompactionWriter writer, @NotNull @NotNull GCNodeWriteMonitor compactionMonitor, int nThreads) Create a new instance based on the passed arguments.- Parameters:
gcListener
- listener receiving notifications about the garbage collection processwriter
- segment writer used to serialise to segmentscompactionMonitor
- notification call back for each compacted nodes, properties, and binariesnThreads
- number of threads to use for parallel compaction, negative numbers are interpreted relative to the number of available processors
-
-
Method Details
-
compactDownWithDelegate
@Nullable protected @Nullable CompactedNodeState compactDownWithDelegate(@NotNull @NotNull NodeState before, @NotNull @NotNull NodeState after, @NotNull @NotNull Canceller hardCanceller, @NotNull @NotNull Canceller softCanceller) throws IOException Description copied from class:CheckpointCompactor
Delegate compaction to another, usually simpler, implementation.- Overrides:
compactDownWithDelegate
in classCheckpointCompactor
- Throws:
IOException
-
compactWithDelegate
@Nullable protected @Nullable CompactedNodeState compactWithDelegate(@NotNull @NotNull NodeState before, @NotNull @NotNull NodeState after, @NotNull @NotNull NodeState onto, @NotNull @NotNull Canceller canceller) throws IOException - Overrides:
compactWithDelegate
in classCheckpointCompactor
- Throws:
IOException
-