@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 Text |
buildTimelineTokenService(Configuration conf) |
static 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,
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(Configuration conf)
Returns the timeline service version.
|
static InetSocketAddress |
getTimelineTokenServiceAddress(Configuration conf) |
static boolean |
timelineServiceEnabled(Configuration conf)
Returns whether the timeline service is enabled via configuration.
|
static boolean |
timelineServiceV1_5Enabled(Configuration conf)
Returns whether the timeline service v.1.5 is enabled 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(Configuration conf)
conf
- the configurationpublic static float getTimelineServiceVersion(Configuration conf)
conf
- the configurationpublic static boolean timelineServiceV1_5Enabled(Configuration conf)
conf
- the configurationpublic static TimelineAbout createTimelineAbout(String about)
public static InetSocketAddress getTimelineTokenServiceAddress(Configuration conf)
public static Text buildTimelineTokenService(Configuration conf)
public static String generateDefaultFlowName(String appName, 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 © 2017 Apache Software Foundation. All rights reserved.