Package org.mapfish.print.processor
Class ProcessorGraphNode<IN,OUT>
- java.lang.Object
-
- org.mapfish.print.processor.ProcessorGraphNode<IN,OUT>
-
public final class ProcessorGraphNode<IN,OUT> extends java.lang.Object
Represents one node in the Processor dependency graph (ProcessorDependencyGraph
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProcessorGraphNode.ProcessorNodeForkJoinTask<In,Out>
A ForkJoinTask that will run the processor and all of its dependencies.
-
Constructor Summary
Constructors Constructor Description ProcessorGraphNode(Processor<IN,OUT> processor, com.codahale.metrics.MetricRegistry metricRegistry)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependency(ProcessorGraphNode node)
Add a dependency to this node.java.util.Optional<ProcessorGraphNode.ProcessorNodeForkJoinTask<IN,OUT>>
createTask(ProcessorExecutionContext execContext)
Create a ForkJoinTask for running in a fork join pool.java.util.Set<? extends Processor<?,?>>
getAllProcessors()
Create a set containing all the processor at the current node and the entire subgraph.protected java.util.Set<ProcessorGraphNode<?,?>>
getDependencies()
com.google.common.collect.BiMap<java.lang.String,java.lang.String>
getInputMapper()
Return input mapper from processor.java.lang.String
getName()
com.google.common.collect.BiMap<java.lang.String,java.lang.String>
getOutputMapper()
Get the output mapper from processor.Processor<?,?>
getProcessor()
protected java.util.Set<ProcessorGraphNode>
getRequirements()
boolean
hasRequirements()
Returns true if the node has requirements, that is there are other nodes that should be run first.java.lang.String
toString()
void
toString(java.lang.StringBuilder builder, int indent, java.lang.String parent)
Create a string representing this node.
-
-
-
Method Detail
-
getProcessor
public Processor<?,?> getProcessor()
-
addDependency
public void addDependency(ProcessorGraphNode node)
Add a dependency to this node.- Parameters:
node
- the dependency to add.
-
getRequirements
protected java.util.Set<ProcessorGraphNode> getRequirements()
-
getDependencies
protected java.util.Set<ProcessorGraphNode<?,?>> getDependencies()
-
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 nodeparent
- the parent node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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.
-
-