Class RuntimeIdManager


  • public final class RuntimeIdManager
    extends java.lang.Object
    ID Generator.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generateBlockId​(java.lang.String runtimeEdgeId, java.lang.String producerTaskId)
      Generates the ID for a block, whose data is the output of a task attempt.
      static java.lang.String generateBlockIdWildcard​(java.lang.String runtimeEdgeId, int producerTaskIndex)
      The block ID wildcard indicates to use 'ANY' of the available blocks produced by different task attempts.
      static java.lang.String generateExecutorId()
      Generates the ID for executor.
      static long generateMessageId()
      Generates the ID for a control message.
      static java.lang.String generatePhysicalPlanId()
      Generates the ID for physical plan.
      static java.lang.String generateStageId​(java.lang.Integer stageId)
      Generates the ID for Stage.
      static java.lang.String generateTaskId​(java.lang.String stageId, int index, int attempt)
      Generates the ID for a task.
      static int getAttemptFromTaskId​(java.lang.String taskId)
      Extracts the attempt from a task ID.
      static int getIndexFromTaskId​(java.lang.String taskId)
      Extracts task index from a task ID.
      static java.lang.String getRuntimeEdgeIdFromBlockId​(java.lang.String blockId)
      Extracts runtime edge ID from a block ID.
      static java.lang.String getStageIdFromTaskId​(java.lang.String taskId)
      Extracts stage ID from a task ID.
      static int getTaskIndexFromBlockId​(java.lang.String blockId)
      Extracts task index from a block ID.
      static java.lang.String getWildCardFromBlockId​(java.lang.String blockId)
      Extracts wild card from a block ID.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • generatePhysicalPlanId

        public static java.lang.String generatePhysicalPlanId()
        Generates the ID for physical plan.
        Returns:
        the generated ID TODO #100: Refactor string-based RuntimeIdGenerator for IR-based DynOpt
      • generateStageId

        public static java.lang.String generateStageId​(java.lang.Integer stageId)
        Generates the ID for Stage.
        Parameters:
        stageId - stage ID in numeric form.
        Returns:
        the generated ID
      • generateTaskId

        public static java.lang.String generateTaskId​(java.lang.String stageId,
                                                      int index,
                                                      int attempt)
        Generates the ID for a task.
        Parameters:
        stageId - the ID of the stage.
        index - the index of this task.
        attempt - the attempt of this task.
        Returns:
        the generated ID
      • generateExecutorId

        public static java.lang.String generateExecutorId()
        Generates the ID for executor.
        Returns:
        the generated ID
      • generateBlockId

        public static java.lang.String generateBlockId​(java.lang.String runtimeEdgeId,
                                                       java.lang.String producerTaskId)
        Generates the ID for a block, whose data is the output of a task attempt.
        Parameters:
        runtimeEdgeId - of the block
        producerTaskId - of the block
        Returns:
        the generated ID
      • generateBlockIdWildcard

        public static java.lang.String generateBlockIdWildcard​(java.lang.String runtimeEdgeId,
                                                               int producerTaskIndex)
        The block ID wildcard indicates to use 'ANY' of the available blocks produced by different task attempts. (Notice that a task clone or a task retry leads to a new task attempt)

        Wildcard block id looks like SEdge4-1-* (task index = 1), where the '*' matches with any task attempts. For this example, the ids of the producer task attempts will look like [Stage1-1-0, Stage1-1-1, Stage1-1-2, ...], with the (1) task stage id corresponding to the outgoing edge, (2) task index = 1, and (3) all task attempts.

        Parameters:
        runtimeEdgeId - of the block
        producerTaskIndex - of the block
        Returns:
        the generated WILDCARD ID
      • generateMessageId

        public static long generateMessageId()
        Generates the ID for a control message.
        Returns:
        the generated ID
      • getRuntimeEdgeIdFromBlockId

        public static java.lang.String getRuntimeEdgeIdFromBlockId​(java.lang.String blockId)
        Extracts runtime edge ID from a block ID.
        Parameters:
        blockId - the block ID to extract.
        Returns:
        the runtime edge ID.
      • getTaskIndexFromBlockId

        public static int getTaskIndexFromBlockId​(java.lang.String blockId)
        Extracts task index from a block ID.
        Parameters:
        blockId - the block ID to extract.
        Returns:
        the task index.
      • getWildCardFromBlockId

        public static java.lang.String getWildCardFromBlockId​(java.lang.String blockId)
        Extracts wild card from a block ID.
        Parameters:
        blockId - the block ID to extract.
        Returns:
        the wild card.
      • getStageIdFromTaskId

        public static java.lang.String getStageIdFromTaskId​(java.lang.String taskId)
        Extracts stage ID from a task ID.
        Parameters:
        taskId - the task ID to extract.
        Returns:
        the stage ID.
      • getIndexFromTaskId

        public static int getIndexFromTaskId​(java.lang.String taskId)
        Extracts task index from a task ID.
        Parameters:
        taskId - the task ID to extract.
        Returns:
        the index.
      • getAttemptFromTaskId

        public static int getAttemptFromTaskId​(java.lang.String taskId)
        Extracts the attempt from a task ID.
        Parameters:
        taskId - the task ID to extract.
        Returns:
        the attempt.