Class SamplingVertex

  • All Implemented Interfaces:
    java.io.Serializable, Cloneable<IRVertex>

    public final class SamplingVertex
    extends IRVertex
    Executes the original IRVertex using a subset of input data partitions.
    See Also:
    Serialized Form
    • 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 class java.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 class Vertex
        Returns:
        JSON representation of additional properties