All Implemented Interfaces:
DocumentProcessor

public class NodeCounter extends AsyncNodeStateProcessor
Count documents and nodes that exist.
  • Constructor Details

  • Method Details

    • 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 class AsyncNodeStateProcessor
      Parameters:
      path - the path of the NodeState to process.
      state - the NodeState or null 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.