Class HBaseTimelineSchemaUtils

java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.HBaseTimelineSchemaUtils

public final class HBaseTimelineSchemaUtils extends Object
A bunch of utility functions used in HBase TimelineService common module.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    milliseconds in one day.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Attribute[]
    Combines the input array of attributes and the input aggregation operation into a new array of attributes.
    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.
    static long
    returns the timestamp of that day's start (which is midnight 00:00:00 AM) for a given input timestamp.
    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).
    static boolean
    Checks if passed object is of integral type(Short/Integer/Long).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MILLIS_ONE_DAY

      public static final long MILLIS_ONE_DAY
      milliseconds in one day.
      See Also:
  • Method Details

    • combineAttributes

      public static Attribute[] combineAttributes(Attribute[] attributes, AggregationOperation aggOp)
      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

      public static boolean isIntegralValue(Object obj)
      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