org.apache.hadoop.hive.hbase
Class HBaseStatsUtils

java.lang.Object
  extended by org.apache.hadoop.hive.hbase.HBaseStatsUtils

public class HBaseStatsUtils
extends Object


Constructor Summary
HBaseStatsUtils()
           
 
Method Summary
static String getBasicStat()
          Returns the basic type of the supported statistics.
static byte[] getColumnName(String statType)
          Returns the HBase column where the statistics for the given type are stored.
static byte[] getFamilyName()
          Returns the family name for stored statistics.
static String getStatFromMap(String statType, Map<String,String> stats)
          Retrieves the value for a particular stat from the published map.
static List<String> getSupportedStatistics()
          Returns the set of supported statistics
static boolean isValidStatistic(String statType)
          Check if a particular statistic type is supported
static boolean isValidStatisticSet(Collection<String> stats)
          Check if the set to be published is within the supported statistics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HBaseStatsUtils

public HBaseStatsUtils()
Method Detail

getSupportedStatistics

public static List<String> getSupportedStatistics()
Returns the set of supported statistics


getStatFromMap

public static String getStatFromMap(String statType,
                                    Map<String,String> stats)
Retrieves the value for a particular stat from the published map.

Parameters:
statType - - statistic type to be retrieved from the map
stats - - stats map
Returns:
value for the given statistic as string, "0" if the statistic is not present

isValidStatisticSet

public static boolean isValidStatisticSet(Collection<String> stats)
Check if the set to be published is within the supported statistics. It must also contain at least the basic statistics (used for comparison).

Parameters:
stats - - stats to be published
Returns:
true if is a valid statistic set, false otherwise

isValidStatistic

public static boolean isValidStatistic(String statType)
Check if a particular statistic type is supported

Parameters:
statType - - statistic to be published
Returns:
true if statType is supported, false otherwise

getColumnName

public static byte[] getColumnName(String statType)
Returns the HBase column where the statistics for the given type are stored.

Parameters:
statType - - supported statistic.
Returns:
column name for the given statistic.

getFamilyName

public static byte[] getFamilyName()
Returns the family name for stored statistics.


getBasicStat

public static String getBasicStat()
Returns the basic type of the supported statistics. It is used to determine which statistics are fresher.



Copyright © 2014 The Apache Software Foundation. All rights reserved.