public final class HBaseTimelineStorageUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MILLIS_ONE_DAY
milliseconds in one day.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
calculateTheClosestNextRowKeyForPrefix(byte[] rowKeyPrefix)
Given a row key prefix stored in a byte array, return a byte array for its
immediate next row key.
|
static Attribute[] |
combineAttributes(Attribute[] attributes,
AggregationOperation aggOp)
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 org.apache.hadoop.hbase.Cell |
createNewCell(byte[] row,
byte[] family,
byte[] qualifier,
long ts,
byte[] newValue,
byte[] tags)
creates a cell with the given inputs.
|
static org.apache.hadoop.hbase.Cell |
createNewCell(org.apache.hadoop.hbase.Cell origCell,
byte[] newValue)
creates a new cell based on the input cell but with the new value.
|
static String |
getAggregationCompactionDimension(List<org.apache.hadoop.hbase.Tag> tags)
returns app id from the list of tags.
|
static AggregationOperation |
getAggregationOperationFromTagsList(List<org.apache.hadoop.hbase.Tag> tags)
Returns the first seen aggregation operation as seen in the list of input
tags or null otherwise.
|
static org.apache.hadoop.hbase.Tag |
getTagFromAttribute(Map.Entry<String,byte[]> attribute)
Creates a
Tag from the input attribute. |
static org.apache.hadoop.conf.Configuration |
getTimelineServiceHBaseConf(org.apache.hadoop.conf.Configuration conf) |
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.
|
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 |
isIntegralValue(Object obj)
Checks if passed object is of integral type(Short/Integer/Long).
|
static void |
setMetricsTimeRange(org.apache.hadoop.hbase.client.Query query,
byte[] metricsCf,
long tsBegin,
long tsEnd) |
public static final long MILLIS_ONE_DAY
public static Attribute[] combineAttributes(Attribute[] attributes, AggregationOperation aggOp)
attributes - Attributes to be combined.aggOp - Aggregation operation.public static AggregationOperation getAggregationOperationFromTagsList(List<org.apache.hadoop.hbase.Tag> tags)
tags - list of HBase tags.public static org.apache.hadoop.hbase.Tag getTagFromAttribute(Map.Entry<String,byte[]> attribute)
Tag from the input attribute.attribute - Attribute from which tag has to be fetched.public static org.apache.hadoop.hbase.Cell createNewCell(org.apache.hadoop.hbase.Cell origCell,
byte[] newValue)
throws IOException
origCell - Original cellnewValue - new cell valueIOException - while creating new cell.public static org.apache.hadoop.hbase.Cell createNewCell(byte[] row,
byte[] family,
byte[] qualifier,
long ts,
byte[] newValue,
byte[] tags)
throws IOException
row - row of the cell to be createdfamily - column family name of the new cellqualifier - qualifier for the new cellts - timestamp of the new cellnewValue - value of the new celltags - tags in the new cellIOException - while creating the cell.public static String getAggregationCompactionDimension(List<org.apache.hadoop.hbase.Tag> tags)
tags - cell tags to be looked intopublic static int invertInt(int key)
key - value to be inverted so that the latest version will be first in
a scan.public static long getTopOfTheDayTimestamp(long ts)
ts - Timestamp.public static String convertApplicationIdToString(org.apache.hadoop.yarn.api.records.ApplicationId appId)
appId - application idpublic static org.apache.hadoop.conf.Configuration getTimelineServiceHBaseConf(org.apache.hadoop.conf.Configuration conf)
throws MalformedURLException
conf - Yarn configuration. Used to see if there is an explicit config
pointing to the HBase config file to read. It should not be null
or a NullPointerException will be thrown.MalformedURLException - if a timeline service HBase configuration URL
is specified but is a malformed URL.public static byte[] calculateTheClosestNextRowKeyForPrefix(byte[] rowKeyPrefix)
rowKeyPrefix - The provided row key prefix, represented in an array.public static boolean isIntegralValue(Object obj)
obj - Object to be checked.public static void setMetricsTimeRange(org.apache.hadoop.hbase.client.Query query,
byte[] metricsCf,
long tsBegin,
long tsEnd)
Copyright © 2018 Apache Software Foundation. All Rights Reserved.