@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 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
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonGenerationException
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
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonGenerationException
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 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–2019 Apache Software Foundation. All rights reserved.