Interface MetricsGatherer<T>
-
- Type Parameters:
T- Type used to return metrics in getMetrics(). This does not impact collection of metrics at all, is only used in that method.
- All Known Implementing Classes:
VisMetricsGatherer
public interface MetricsGatherer<T>Interface used to gather metrics from RFiles.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMetric(Key key, Value val)Collect and store metrics for the given entry.TgetMetrics()voidinit(Map<String,ArrayList<ByteSequence>> cf)Initialize the gatherer when it is registered with the RFile ReadervoidprintMetrics(boolean hash, String metricWord, PrintStream out)Print the results of the metrics gathering by locality group in the format: Metric name Number of keys Percentage of keys Number of blocks Percentage of blocksvoidstartBlock()Start a new block within a LocalityGroup.voidstartLocalityGroup(org.apache.hadoop.io.Text cf)Start a new LocalityGroup.
-
-
-
Method Detail
-
init
void init(Map<String,ArrayList<ByteSequence>> cf)
Initialize the gatherer when it is registered with the RFile Reader- Parameters:
cf- Map of the LocalityGroup names to their column families
-
startLocalityGroup
void startLocalityGroup(org.apache.hadoop.io.Text cf)
Start a new LocalityGroup. This method is used when the RFile seeks to the next LocalityGroup.- Parameters:
cf- Text object of the column family of the first entry in the locality group
-
addMetric
void addMetric(Key key, Value val)
Collect and store metrics for the given entry.- Parameters:
key- Key object of the entry you are collecting metrics fromval- Value object of the entry you are collecting metrics from
-
startBlock
void startBlock()
Start a new block within a LocalityGroup. This method is used when the RFile moves on the the next block in the LocalityGroup.
-
printMetrics
void printMetrics(boolean hash, String metricWord, PrintStream out)Print the results of the metrics gathering by locality group in the format: Metric name Number of keys Percentage of keys Number of blocks Percentage of blocks- Parameters:
hash- Boolean to determine whether the values being printed should be hashedmetricWord- String of the name of the metric that was collectedout- PrintStream of where the information should be written to
-
getMetrics
T getMetrics()
- Returns:
- the metrics gathered
-
-