Class TaskSizeSplitterVertex
- java.lang.Object
-
- org.apache.nemo.common.dag.Vertex
-
- org.apache.nemo.common.ir.vertex.IRVertex
-
- org.apache.nemo.common.ir.vertex.LoopVertex
-
- org.apache.nemo.common.ir.vertex.utility.TaskSizeSplitterVertex
-
public final class TaskSizeSplitterVertex extends LoopVertex
This vertex works as a partition-based sampling vertex of dynamic task sizing pass. It covers both sampling vertices and optimized vertices known from sampling by iterating same vertices, giving different properties in each iteration.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskSizeSplitterVertex(java.lang.String splitterVertexName, java.util.Set<IRVertex> originalVertices, java.util.Set<IRVertex> groupStartingVertices, java.util.Set<IRVertex> verticesWithGroupOutgoingEdges, java.util.Set<IRVertex> groupEndingVertices, java.util.Set<IREdge> edgesBetweenOriginalVertices, int partitionerProperty)
Default constructor of TaskSizeSplitterVertex.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<IREdge>
getEdgesFromOriginalToOutside(DAG<IRVertex,IREdge> dag)
Get edges which come from original vertices to outer destinations by observing the dag.java.util.Set<IREdge>
getEdgesFromOutsideToOriginal(DAG<IRVertex,IREdge> dag)
Get edges which come to original vertices from outer sources by observing the dag.java.util.Set<IREdge>
getEdgesFromOutsideToSplitter(DAG<IRVertex,IREdge> dag)
Get edges which come to splitter from outside sources.java.util.Set<IREdge>
getEdgesFromSplitterToOutside(DAG<IRVertex,IREdge> dag)
Get edges which come out from splitter to outside destinations.java.util.Set<IRVertex>
getGroupEndingVertices()
java.util.Set<IRVertex>
getGroupStartingVertices()
java.util.Set<IRVertex>
getOriginalVertices()
java.util.Set<IRVertex>
getVerticesWithGroupOutgoingEdges()
void
increaseTestingTrial()
void
printLogs()
TaskSizeSplitterVertex
unRollIteration(DAGBuilder<IRVertex,IREdge> dagBuilder)
Need to be careful about Signal Vertex, because they do not appear in the last iteration.-
Methods inherited from class org.apache.nemo.common.ir.vertex.LoopVertex
addDagIncomingEdge, addDagOutgoingEdge, addIterativeIncomingEdge, addNonIterativeIncomingEdge, decreaseMaxNumberOfIterations, getBuilder, getClone, getDAG, getDagIncomingEdges, getDagOutgoingEdges, getEdgeWithInternalVertex, getEdgeWithInternalVertexToEdgeWithLoop, getEdgeWithLoop, getEdgeWithLoopToEdgeWithInternalVertex, getIterativeIncomingEdges, getMaxNumberOfIterations, getName, getNonIterativeIncomingEdges, getPropertiesAsJsonNode, getTerminationCondition, increaseMaxNumberOfIterations, loopTerminationConditionMet, loopTerminationConditionMet, mapEdgeWithLoop, markDuplicateEdges, removeDagIncomingEdge, removeDagOutgoingEdge, removeIterativeIncomingEdge, removeNonIterativeIncomingEdge, setMaxNumberOfIterations, setTerminationCondition, terminationConditionEquals
-
Methods inherited from class org.apache.nemo.common.ir.vertex.IRVertex
copyExecutionPropertiesTo, getExecutionProperties, getIRVertexPropertiesAsJsonNode, getPropertyValue, isUtilityVertex, setProperty, setPropertyPermanently
-
Methods inherited from class org.apache.nemo.common.dag.Vertex
getId, getNumericId
-
-
-
-
Constructor Detail
-
TaskSizeSplitterVertex
public TaskSizeSplitterVertex(java.lang.String splitterVertexName, java.util.Set<IRVertex> originalVertices, java.util.Set<IRVertex> groupStartingVertices, java.util.Set<IRVertex> verticesWithGroupOutgoingEdges, java.util.Set<IRVertex> groupEndingVertices, java.util.Set<IREdge> edgesBetweenOriginalVertices, int partitionerProperty)
Default constructor of TaskSizeSplitterVertex.- Parameters:
splitterVertexName
- for now, this doesn't do anything. This is inserted to enable extension from LoopVertex.originalVertices
- Set of vertices which form one stage and which splitter will wrap up.groupStartingVertices
- The first vertex in stage. Although it is given as a Set, we assert that this set has only one element (guaranteed by stage partitioner logic)verticesWithGroupOutgoingEdges
- Vertices which has outgoing edges to other stage.groupEndingVertices
- Vertices which has only outgoing edges to other stage.edgesBetweenOriginalVertices
- Edges which connects original vertices.partitionerProperty
- PartitionerProperty of incoming stage edge regarding to job data size. For more information, check
-
-
Method Detail
-
getOriginalVertices
public java.util.Set<IRVertex> getOriginalVertices()
-
getGroupStartingVertices
public java.util.Set<IRVertex> getGroupStartingVertices()
-
getVerticesWithGroupOutgoingEdges
public java.util.Set<IRVertex> getVerticesWithGroupOutgoingEdges()
-
getGroupEndingVertices
public java.util.Set<IRVertex> getGroupEndingVertices()
-
increaseTestingTrial
public void increaseTestingTrial()
-
unRollIteration
public TaskSizeSplitterVertex unRollIteration(DAGBuilder<IRVertex,IREdge> dagBuilder)
Need to be careful about Signal Vertex, because they do not appear in the last iteration.- Overrides:
unRollIteration
in classLoopVertex
- Parameters:
dagBuilder
- DAGBuilder to add the unrolled iteration to.- Returns:
- Modified this object
-
getEdgesFromOutsideToOriginal
public java.util.Set<IREdge> getEdgesFromOutsideToOriginal(DAG<IRVertex,IREdge> dag)
Get edges which come to original vertices from outer sources by observing the dag. This will be the 'dagIncomingEdges' in Splitter vertex. Edge case: Happens when previous vertex(i.e. outer source) is also a splitter vertex. In this case, we need to get original edges which is invisible from the dag by hacking into previous splitter vertex.- Parameters:
dag
- dag to insert Splitter Vertex.- Returns:
- a set of edges from outside to original vertices.
-
getEdgesFromOriginalToOutside
public java.util.Set<IREdge> getEdgesFromOriginalToOutside(DAG<IRVertex,IREdge> dag)
Get edges which come from original vertices to outer destinations by observing the dag. This will be the 'dagOutgoingEdges' in Splitter vertex. Edge case: Happens when the vertex to be executed after the splitter vertex (i.e. outer destination) is also a splitter vertex. In this case, we need to get original edges which is invisible from the dag by hacking into next splitter vertex.- Parameters:
dag
- dag to insert Splitter Vertex.- Returns:
- a set of edges from original vertices to outside.
-
getEdgesFromOutsideToSplitter
public java.util.Set<IREdge> getEdgesFromOutsideToSplitter(DAG<IRVertex,IREdge> dag)
Get edges which come to splitter from outside sources. These edges have a one-to-one relationship with edgesFromOutsideToOriginal. Edge case: Happens when previous vertex(i.e. outer source) is also a splitter vertex. In this case, we need to modify the prevSplitter's LoopEdge - InternalEdge mapping relationship, since inserting this Splitter Vertex changes the destination of prevSplitter's LoopEdge from the original vertex to this Splitter Vertex- Parameters:
dag
- dag to insert Splitter Vertex- Returns:
- a set of edges pointing at Splitter Vertex
-
getEdgesFromSplitterToOutside
public java.util.Set<IREdge> getEdgesFromSplitterToOutside(DAG<IRVertex,IREdge> dag)
Get edges which come out from splitter to outside destinations. These edges have a one-to-one relationship with edgesFromOriginalToOutside. Edge case: Happens when vertex to be executed after this Splitter Vertex(i.e. outer destination) is also a Splitter Vertex. In this case, we need to modify the nextSplitter's LoopEdge - InternalEdge mapping relationship, since inserting this Splitter Vertex changes the source of prevSplitter's LoopEdge from the original vertex to this Splitter Vertex.- Parameters:
dag
- dag to insert Splitter Vertex.- Returns:
- a set of edges coming out from Splitter Vertex.
-
printLogs
public void printLogs()
-
-