Class ProcessorGraphNode<IN,​OUT>

  • Type Parameters:
    IN - Same as Processor In parameter
    OUT - Same as Processor Out parameter

    public final class ProcessorGraphNode<IN,​OUT>
    extends java.lang.Object
    Represents one node in the Processor dependency graph (ProcessorDependencyGraph).
    • Constructor Detail

      • ProcessorGraphNode

        public ProcessorGraphNode​(@Nonnull
                                  Processor<IN,​OUT> processor,
                                  @Nonnull
                                  com.codahale.metrics.MetricRegistry metricRegistry)
        Constructor.
        Parameters:
        processor - The processor associated with this node.
        metricRegistry - registry for timing the execution time of the processor.
    • Method Detail

      • getProcessor

        public Processor<?,​?> getProcessor()
      • addDependency

        public void addDependency​(ProcessorGraphNode node)
        Add a dependency to this node.
        Parameters:
        node - the dependency to add.
      • hasRequirements

        public boolean hasRequirements()
        Returns true if the node has requirements, that is there are other nodes that should be run first.
      • createTask

        public java.util.Optional<ProcessorGraphNode.ProcessorNodeForkJoinTask<IN,​OUT>> createTask​(@Nonnull
                                                                                                         ProcessorExecutionContext execContext)
        Create a ForkJoinTask for running in a fork join pool.
        Parameters:
        execContext - the execution context, used for tracking certain aspects of the execution.
        Returns:
        a task ready to be submitted to a fork join pool.
      • getOutputMapper

        @Nonnull
        public com.google.common.collect.BiMap<java.lang.String,​java.lang.String> getOutputMapper()
        Get the output mapper from processor.
      • getInputMapper

        @Nonnull
        public com.google.common.collect.BiMap<java.lang.String,​java.lang.String> getInputMapper()
        Return input mapper from processor.
      • toString

        public void toString​(java.lang.StringBuilder builder,
                             int indent,
                             java.lang.String parent)
        Create a string representing this node.
        Parameters:
        builder - the builder to add the string to.
        indent - the number of steps of indent for this node
        parent - the parent node
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getName

        public java.lang.String getName()
      • getAllProcessors

        public java.util.Set<? extends Processor<?,​?>> getAllProcessors()
        Create a set containing all the processor at the current node and the entire subgraph.