@InterfaceAudience.Public @InterfaceStability.Evolving public class TimelineUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FLOW_VERSION |
static String |
FLOW_NAME_TAG_PREFIX |
static String |
FLOW_RUN_ID_TAG_PREFIX |
static String |
FLOW_VERSION_TAG_PREFIX |
Constructor and Description |
---|
TimelineUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.io.Text |
buildTimelineTokenService(org.apache.hadoop.conf.Configuration conf) |
static org.apache.hadoop.yarn.api.records.timeline.TimelineAbout |
createTimelineAbout(String about) |
static String |
dumpTimelineRecordtoJSON(Object o)
Serialize a POJO object into a JSON string not in a pretty format
|
static String |
dumpTimelineRecordtoJSON(Object o,
boolean pretty)
Serialize a POJO object into a JSON string
|
static String |
generateDefaultFlowName(String appName,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
static String |
generateFlowNameTag(String flowName)
Generate flow name tag.
|
static String |
generateFlowRunIdTag(long flowRunId)
Generate flow run ID tag.
|
static String |
generateFlowVersionTag(String flowVersion)
Generate flow version tag.
|
static float |
getTimelineServiceVersion(org.apache.hadoop.conf.Configuration conf)
Returns the timeline service version.
|
static InetSocketAddress |
getTimelineTokenServiceAddress(org.apache.hadoop.conf.Configuration conf) |
static String |
shortenFlowName(String flowName,
org.apache.hadoop.conf.Configuration conf)
Shortens the flow name for the configured size by removing UUID if present.
|
static boolean |
timelineServiceEnabled(org.apache.hadoop.conf.Configuration conf)
Returns whether the timeline service is enabled via configuration.
|
static boolean |
timelineServiceV1_5Enabled(org.apache.hadoop.conf.Configuration conf)
Returns whether the timeline service v.1.5 is enabled by default via
configuration.
|
public static final String FLOW_NAME_TAG_PREFIX
public static final String FLOW_VERSION_TAG_PREFIX
public static final String FLOW_RUN_ID_TAG_PREFIX
public static final String DEFAULT_FLOW_VERSION
public static String dumpTimelineRecordtoJSON(Object o) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
o
- an object to serializeIOException
- 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.public static String dumpTimelineRecordtoJSON(Object o, boolean pretty) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
o
- an object to serializepretty
- whether in a pretty format or notIOException
- 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.public static boolean timelineServiceEnabled(org.apache.hadoop.conf.Configuration conf)
conf
- the configurationpublic static float getTimelineServiceVersion(org.apache.hadoop.conf.Configuration conf)
conf
- the configurationpublic static boolean timelineServiceV1_5Enabled(org.apache.hadoop.conf.Configuration conf)
conf
- the configurationpublic static org.apache.hadoop.yarn.api.records.timeline.TimelineAbout createTimelineAbout(String about)
public static InetSocketAddress getTimelineTokenServiceAddress(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.io.Text buildTimelineTokenService(org.apache.hadoop.conf.Configuration conf)
public static String generateDefaultFlowName(String appName, org.apache.hadoop.yarn.api.records.ApplicationId appId)
public static String generateFlowNameTag(String flowName)
flowName
- flow name that identifies a distinct flow application which
can be run repeatedly over timepublic static String shortenFlowName(String flowName, org.apache.hadoop.conf.Configuration conf)
flowName
- which has to be shortenedconf
- to resize the flow namepublic static String generateFlowVersionTag(String flowVersion)
flowVersion
- flow version that keeps track of the changes made to the
flowpublic static String generateFlowRunIdTag(long flowRunId)
flowRunId
- flow run ID that identifies one instance (or specific
execution) of that flowCopyright © 2008–2024 Apache Software Foundation. All rights reserved.