Class TimelineUtils

java.lang.Object
org.apache.hadoop.yarn.util.timeline.TimelineUtils

@Public @Evolving public class TimelineUtils extends Object
The helper class for the timeline module.
  • Field Details

  • Constructor Details

    • TimelineUtils

      public TimelineUtils()
  • Method Details

    • dumpTimelineRecordtoJSON

      public static String dumpTimelineRecordtoJSON(Object o) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
      Serialize a POJO object into a JSON string not in a pretty format
      Parameters:
      o - an object to serialize
      Returns:
      a JSON string
      Throws:
      IOException - io error occur.
      com.fasterxml.jackson.databind.JsonMappingException - exception used to signal fatal problems with mapping of content.
      com.fasterxml.jackson.core.JsonGenerationException - exception type for exceptions during JSON writing.
    • dumpTimelineRecordtoJSON

      public static String dumpTimelineRecordtoJSON(Object o, boolean pretty) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
      Serialize a POJO object into a JSON string
      Parameters:
      o - an object to serialize
      pretty - whether in a pretty format or not
      Returns:
      a JSON string
      Throws:
      IOException - io error occur.
      com.fasterxml.jackson.databind.JsonMappingException - exception used to signal fatal problems with mapping of content.
      com.fasterxml.jackson.core.JsonGenerationException - exception type for exceptions during JSON writing.
    • timelineServiceEnabled

      public static boolean timelineServiceEnabled(Configuration conf)
      Returns whether the timeline service is enabled via configuration.
      Parameters:
      conf - the configuration
      Returns:
      whether the timeline service is enabled.
    • getTimelineServiceVersion

      public static float getTimelineServiceVersion(Configuration conf)
      Returns the timeline service version. It does not check whether the timeline service itself is enabled.
      Parameters:
      conf - the configuration
      Returns:
      the timeline service version as a float.
    • timelineServiceV1_5Enabled

      public static boolean timelineServiceV1_5Enabled(Configuration conf)
      Returns whether the timeline service v.1.5 is enabled by default via configuration.
      Parameters:
      conf - the configuration
      Returns:
      whether the timeline service v.1.5 is enabled. V.1.5 refers to a version equal to 1.5.
    • createTimelineAbout

      public static TimelineAbout createTimelineAbout(String about)
    • getTimelineTokenServiceAddress

      public static InetSocketAddress getTimelineTokenServiceAddress(Configuration conf)
    • buildTimelineTokenService

      public static Text buildTimelineTokenService(Configuration conf)
    • generateDefaultFlowName

      public static String generateDefaultFlowName(String appName, ApplicationId appId)
    • generateFlowNameTag

      public static String generateFlowNameTag(String flowName)
      Generate flow name tag.
      Parameters:
      flowName - flow name that identifies a distinct flow application which can be run repeatedly over time
      Returns:
      flow name tag.
    • shortenFlowName

      public static String shortenFlowName(String flowName, Configuration conf)
      Shortens the flow name for the configured size by removing UUID if present.
      Parameters:
      flowName - which has to be shortened
      conf - to resize the flow name
      Returns:
      shortened flowName
    • generateFlowVersionTag

      public static String generateFlowVersionTag(String flowVersion)
      Generate flow version tag.
      Parameters:
      flowVersion - flow version that keeps track of the changes made to the flow
      Returns:
      flow version tag.
    • generateFlowRunIdTag

      public static String generateFlowRunIdTag(long flowRunId)
      Generate flow run ID tag.
      Parameters:
      flowRunId - flow run ID that identifies one instance (or specific execution) of that flow
      Returns:
      flow run id tag.