Class RuntimeIdManager


  • public final class RuntimeIdManager
    extends Object
    ID Generator.
    • Method Detail

      • generatePhysicalPlanId

        public static 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 String generateStageId​(Integer stageId)
        Generates the ID for Stage.
        Parameters:
        stageId - stage ID in numeric form.
        Returns:
        the generated ID
      • generateTaskId

        public static String generateTaskId​(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 String generateExecutorId()
        Generates the ID for executor.
        Returns:
        the generated ID
      • generateBlockId

        public static String generateBlockId​(String runtimeEdgeId,
                                             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 String generateBlockIdWildcard​(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
      • generateResourceSpecId

        public static String generateResourceSpecId()
        Generates the ID for a resource specification.
        Returns:
        the generated ID
      • getRuntimeEdgeIdFromBlockId

        public static String getRuntimeEdgeIdFromBlockId​(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​(String blockId)
        Extracts task index from a block ID.
        Parameters:
        blockId - the block ID to extract.
        Returns:
        the task index.
      • getWildCardFromBlockId

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

        public static String getStageIdFromTaskId​(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​(String taskId)
        Extracts task index from a task ID.
        Parameters:
        taskId - the task ID to extract.
        Returns:
        the index.
      • getAttemptFromTaskId

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