Class HBaseTimelineServerUtils
java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.HBaseTimelineServerUtils
A utility class used by hbase-server module.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.apache.hadoop.hbase.Tag>convertCellAsTagList(org.apache.hadoop.hbase.Cell cell) Convert a cell to a list of tags.static byte[]convertTagListToByteArray(List<org.apache.hadoop.hbase.Tag> tags) Convert a list of tags to a byte array.static org.apache.hadoop.hbase.CellcreateNewCell(byte[] row, byte[] family, byte[] qualifier, long ts, byte[] newValue, byte[] tags) creates a cell with the given inputs.static org.apache.hadoop.hbase.CellcreateNewCell(org.apache.hadoop.hbase.Cell origCell, byte[] newValue) creates a new cell based on the input cell but with the new value.static org.apache.hadoop.hbase.TagcreateTag(byte tagType, byte[] tag) Create a Tag.static org.apache.hadoop.hbase.TagCreate a Tag.static intflushCompactTableRegions(org.apache.hadoop.hbase.regionserver.HRegionServer server, org.apache.hadoop.hbase.TableName table) Flush and compact all regions of a table.static StringgetAggregationCompactionDimension(List<org.apache.hadoop.hbase.Tag> tags) returns app id from the list of tags.static org.apache.hadoop.yarn.server.timelineservice.storage.flow.AggregationOperationgetAggregationOperationFromTagsList(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.TaggetTagFromAttribute(Map.Entry<String, byte[]> attribute) Creates aTagfrom the input attribute.static voidvalidateFlowRunCoprocessor(org.apache.hadoop.hbase.regionserver.HRegionServer server, org.apache.hadoop.hbase.TableName table, boolean existenceExpected) Check the existence of FlowRunCoprocessor in a table.
-
Method Details
-
getTagFromAttribute
Creates aTagfrom the input attribute.- Parameters:
attribute- Attribute from which tag has to be fetched.- Returns:
- a HBase Tag.
-
createNewCell
public static org.apache.hadoop.hbase.Cell createNewCell(org.apache.hadoop.hbase.Cell origCell, byte[] newValue) throws IOException creates a new cell based on the input cell but with the new value.- Parameters:
origCell- Original cellnewValue- new cell value- Returns:
- cell
- Throws:
IOException- while creating new cell.
-
createNewCell
public static org.apache.hadoop.hbase.Cell createNewCell(byte[] row, byte[] family, byte[] qualifier, long ts, byte[] newValue, byte[] tags) throws IOException creates a cell with the given inputs.- Parameters:
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 cell- Returns:
- cell
- Throws:
IOException- while creating the cell.
-
createTag
public static org.apache.hadoop.hbase.Tag createTag(byte tagType, byte[] tag) Create a Tag.- Parameters:
tagType- tag typetag- the content of the tag in byte array.- Returns:
- an instance of Tag
-
createTag
Create a Tag.- Parameters:
tagType- tag typetag- the content of the tag in String.- Returns:
- an instance of Tag
-
convertCellAsTagList
public static List<org.apache.hadoop.hbase.Tag> convertCellAsTagList(org.apache.hadoop.hbase.Cell cell) Convert a cell to a list of tags.- Parameters:
cell- the cell to convert- Returns:
- a list of tags
-
convertTagListToByteArray
Convert a list of tags to a byte array.- Parameters:
tags- the list of tags to convert- Returns:
- byte array representation of the list of tags
-
getAggregationCompactionDimension
returns app id from the list of tags.- Parameters:
tags- cell tags to be looked into- Returns:
- App Id as the AggregationCompactionDimension
-
getAggregationOperationFromTagsList
public static org.apache.hadoop.yarn.server.timelineservice.storage.flow.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.- Parameters:
tags- list of HBase tags.- Returns:
- AggregationOperation
-
flushCompactTableRegions
public static int flushCompactTableRegions(org.apache.hadoop.hbase.regionserver.HRegionServer server, org.apache.hadoop.hbase.TableName table) throws IOException Flush and compact all regions of a table.- Parameters:
server- region servertable- the table to flush and compact- Returns:
- the number of regions flushed and compacted
- Throws:
IOException- any IOE raised, or translated exception.
-
validateFlowRunCoprocessor
public static void validateFlowRunCoprocessor(org.apache.hadoop.hbase.regionserver.HRegionServer server, org.apache.hadoop.hbase.TableName table, boolean existenceExpected) throws Exception Check the existence of FlowRunCoprocessor in a table.- Parameters:
server- region servertable- table to checkexistenceExpected- true if the FlowRunCoprocessor is expected to be loaded in the table, false otherwise- Throws:
Exception- Exception if any.
-