Class NodeCounter
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.check.AsyncDocumentProcessor
-
- org.apache.jackrabbit.oak.plugins.document.check.AsyncNodeStateProcessor
-
- org.apache.jackrabbit.oak.plugins.document.check.NodeCounter
-
- All Implemented Interfaces:
DocumentProcessor
public class NodeCounter extends AsyncNodeStateProcessor
Count documents and nodes that exist.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.plugins.document.check.AsyncNodeStateProcessor
AsyncNodeStateProcessor.NodeStateTask
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.plugins.document.check.AsyncNodeStateProcessor
headRevision, ns, uuidIndex
-
-
Constructor Summary
Constructors Constructor Description NodeCounter(DocumentNodeStore ns, RevisionVector headRevision, ExecutorService executorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end(@NotNull BlockingQueue<Result> results)
This method is called after the last document has been processed.protected void
runTask(@NotNull Path path, @Nullable NodeState state, @NotNull Consumer<Result> resultConsumer)
Responsibility of the subclass to implement the processor logic.-
Methods inherited from class org.apache.jackrabbit.oak.plugins.document.check.AsyncNodeStateProcessor
createTask, getNodeByUUID, process
-
Methods inherited from class org.apache.jackrabbit.oak.plugins.document.check.AsyncDocumentProcessor
processDocument
-
-
-
-
Constructor Detail
-
NodeCounter
public NodeCounter(DocumentNodeStore ns, RevisionVector headRevision, ExecutorService executorService)
-
-
Method Detail
-
runTask
protected void runTask(@NotNull @NotNull Path path, @Nullable @Nullable NodeState state, @NotNull @NotNull Consumer<Result> resultConsumer)
Description copied from class:AsyncNodeStateProcessor
Responsibility of the subclass to implement the processor logic. This method will run as a task with an executor service.- Specified by:
runTask
in classAsyncNodeStateProcessor
- Parameters:
path
- the path of theNodeState
to process.state
- theNodeState
ornull
if the node does not exist at this path. This may happen for nodes that have been deleted but not yet garbage collected.resultConsumer
- consumes the results of this task.
-
end
public void end(@NotNull @NotNull BlockingQueue<Result> results) throws InterruptedException
Description copied from interface:DocumentProcessor
This method is called after the last document has been processed. An implementation may wish to publish aggregated results at the end.- Parameters:
results
- the queue to publish results if necessary.- Throws:
InterruptedException
- if publishing a result is interrupted.
-
-