Class AsyncNodeStateProcessor

    • 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 String uuid,
                                                          @NotNull
                                                          @NotNull AtomicReference<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.
      • runTask

        protected abstract void runTask​(@NotNull
                                        @NotNull Path path,
                                        @Nullable
                                        @Nullable NodeState state,
                                        @NotNull
                                        @NotNull 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.