Class TimelineUtils
java.lang.Object
org.apache.hadoop.yarn.util.timeline.TimelineUtils
The helper class for the timeline module.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Textstatic TimelineAboutcreateTimelineAbout(String about) static StringSerialize a POJO object into a JSON string not in a pretty formatstatic StringdumpTimelineRecordtoJSON(Object o, boolean pretty) Serialize a POJO object into a JSON stringstatic StringgenerateDefaultFlowName(String appName, ApplicationId appId) static StringgenerateFlowNameTag(String flowName) Generate flow name tag.static StringgenerateFlowRunIdTag(long flowRunId) Generate flow run ID tag.static StringgenerateFlowVersionTag(String flowVersion) Generate flow version tag.static floatReturns the timeline service version.static InetSocketAddressstatic StringshortenFlowName(String flowName, Configuration conf) Shortens the flow name for the configured size by removing UUID if present.static booleanReturns whether the timeline service is enabled via configuration.static booleanReturns whether the timeline service v.1.5 is enabled by default via configuration.
-
Field Details
-
FLOW_NAME_TAG_PREFIX
- See Also:
-
FLOW_VERSION_TAG_PREFIX
- See Also:
-
FLOW_RUN_ID_TAG_PREFIX
- See Also:
-
DEFAULT_FLOW_VERSION
- See Also:
-
-
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 serializepretty- 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
Returns whether the timeline service is enabled via configuration.- Parameters:
conf- the configuration- Returns:
- whether the timeline service is enabled.
-
getTimelineServiceVersion
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
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
-
getTimelineTokenServiceAddress
-
buildTimelineTokenService
-
generateDefaultFlowName
-
generateFlowNameTag
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
Shortens the flow name for the configured size by removing UUID if present.- Parameters:
flowName- which has to be shortenedconf- to resize the flow name- Returns:
- shortened flowName
-
generateFlowVersionTag
Generate flow version tag.- Parameters:
flowVersion- flow version that keeps track of the changes made to the flow- Returns:
- flow version tag.
-
generateFlowRunIdTag
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.
-