Class SamplingVertex
- java.lang.Object
-
- org.apache.nemo.common.dag.Vertex
-
- org.apache.nemo.common.ir.vertex.IRVertex
-
- org.apache.nemo.common.ir.vertex.utility.SamplingVertex
-
public final class SamplingVertex extends IRVertex
Executes the original IRVertex using a subset of input data partitions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SamplingVertex(IRVertex originalVertex, float desiredSampleRate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IRVertex
getClone()
Creates and returns a copy of this object.IREdge
getCloneOfOriginalEdge(IREdge originalEdge)
Obtains a clone of an original edge that is attached to this sampling vertex.IRVertex
getCloneOfOriginalVertex()
float
getDesiredSampleRate()
java.lang.String
getOriginalVertexId()
com.fasterxml.jackson.databind.node.ObjectNode
getPropertiesAsJsonNode()
java.lang.String
toString()
-
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
-
SamplingVertex
public SamplingVertex(IRVertex originalVertex, float desiredSampleRate)
- Parameters:
originalVertex
- to clone.desiredSampleRate
- percentage of tasks to execute. The actual sample rate may vary depending on neighboring sampling vertices.
-
-
Method Detail
-
getOriginalVertexId
public java.lang.String getOriginalVertexId()
- Returns:
- the id of the original vertex for reference.
-
getCloneOfOriginalVertex
public IRVertex getCloneOfOriginalVertex()
- Returns:
- the clone of the original vertex. This clone is intended to be used during the actual execution, as the sampling vertex itself is not executable and the original vertex should not be executed again.
-
getDesiredSampleRate
public float getDesiredSampleRate()
- Returns:
- the desired sample rate.
-
getCloneOfOriginalEdge
public IREdge getCloneOfOriginalEdge(IREdge originalEdge)
Obtains a clone of an original edge that is attached to this sampling vertex.Original edge: src - to - dst When src == originalVertex, return thisSamplingVertex - to - dst When dst == originalVertex, return src - to - thisSamplingVertex
- Parameters:
originalEdge
- to clone.- Returns:
- a clone of the edge.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getClone
public IRVertex getClone()
Description copied from interface:Cloneable
Creates and returns a copy of this object.The precise meaning of "copy" may depend on the class of the object. The general intent is that, all fields of the object are copied.
- Returns:
- a clone of this object.
-
getPropertiesAsJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode getPropertiesAsJsonNode()
- Overrides:
getPropertiesAsJsonNode
in classVertex
- Returns:
- JSON representation of additional properties
-
-