Class HBaseTimelineSchemaUtils
java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.HBaseTimelineSchemaUtils
A bunch of utility functions used in HBase TimelineService common module.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Attribute[]combineAttributes(Attribute[] attributes, AggregationOperation aggOp) Combines the input array of attributes and the input aggregation operation into a new array of attributes.static StringconvertApplicationIdToString(org.apache.hadoop.yarn.api.records.ApplicationId appId) A utility method that converts ApplicationId to string without using FastNumberFormat in order to avoid the incompatibility issue caused by mixing hadoop-common 2.5.1 and hadoop-yarn-api 3.0 in this module.static longgetTopOfTheDayTimestamp(long ts) returns the timestamp of that day's start (which is midnight 00:00:00 AM) for a given input timestamp.static intinvertInt(int key) Converts an int into it's inverse int to be used in (row) keys where we want to have the largest int value in the top of the table (scans start at the largest int first).static booleanisIntegralValue(Object obj) Checks if passed object is of integral type(Short/Integer/Long).
-
Field Details
-
MILLIS_ONE_DAY
public static final long MILLIS_ONE_DAYmilliseconds in one day.- See Also:
-
-
Method Details
-
combineAttributes
Combines the input array of attributes and the input aggregation operation into a new array of attributes.- Parameters:
attributes- Attributes to be combined.aggOp- Aggregation operation.- Returns:
- array of combined attributes.
-
invertInt
public static int invertInt(int key) Converts an int into it's inverse int to be used in (row) keys where we want to have the largest int value in the top of the table (scans start at the largest int first).- Parameters:
key- value to be inverted so that the latest version will be first in a scan.- Returns:
- inverted int
-
getTopOfTheDayTimestamp
public static long getTopOfTheDayTimestamp(long ts) returns the timestamp of that day's start (which is midnight 00:00:00 AM) for a given input timestamp.- Parameters:
ts- Timestamp.- Returns:
- timestamp of that day's beginning (midnight)
-
isIntegralValue
Checks if passed object is of integral type(Short/Integer/Long).- Parameters:
obj- Object to be checked.- Returns:
- true if object passed is of type Short or Integer or Long, false otherwise.
-
convertApplicationIdToString
public static String convertApplicationIdToString(org.apache.hadoop.yarn.api.records.ApplicationId appId) A utility method that converts ApplicationId to string without using FastNumberFormat in order to avoid the incompatibility issue caused by mixing hadoop-common 2.5.1 and hadoop-yarn-api 3.0 in this module. This is a work-around implementation as discussed in YARN-6905.- Parameters:
appId- application id- Returns:
- the string representation of the given application id
-