Class AsyncNodeStateProcessor

    • Constructor Detail

      • AsyncNodeStateProcessor

        protected AsyncNodeStateProcessor​(DocumentNodeStore ns,
                                          RevisionVector headRevision,
                                          java.util.concurrent.ExecutorService executorService)
    • Method Detail

      • process

        protected boolean process​(NodeDocument doc)
        Decide early whether a NodeDocument should be processed or not. This implementation returns true if the document not a split document, otherwise false. This method can be overridden by subclasses.
        Parameters:
        doc - the document to process.
        Returns:
        whether the document should be processed or ignored.
      • getNodeByUUID

        @Nullable
        protected final @Nullable NodeState getNodeByUUID​(@NotNull
                                                          @NotNull java.lang.String uuid,
                                                          @NotNull
                                                          @NotNull java.util.concurrent.atomic.AtomicReference<java.lang.String> resolvedPath)
        Utility method that resolves he uuid into a NodeState with the help of the UUID index.
        Parameters:
        uuid - the UUID to resolve.
        resolvedPath - will be set to the resolved path if available.
        Returns:
        the NodeState with the given UUID or null if it cannot be resolved or doesn't exist.
      • createTask

        protected final java.util.Optional<java.util.concurrent.Callable<java.lang.Void>> createTask​(@NotNull
                                                                                                     @NotNull NodeDocument document,
                                                                                                     @NotNull
                                                                                                     @NotNull java.util.concurrent.BlockingQueue<Result> results)
        Specified by:
        createTask in class AsyncDocumentProcessor
      • runTask

        protected abstract void runTask​(@NotNull
                                        @NotNull Path path,
                                        @Nullable
                                        @Nullable NodeState state,
                                        @NotNull
                                        @NotNull java.util.function.Consumer<Result> resultConsumer)
        Responsibility of the subclass to implement the processor logic. This method will run as a task with an executor service.
        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.