Class VisMetricsGatherer
- java.lang.Object
-
- org.apache.accumulo.core.file.rfile.VisMetricsGatherer
-
- All Implemented Interfaces:
MetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>
public class VisMetricsGatherer extends Object implements MetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>
This class provides visibility metrics per locality group. The Map in getMetrics() maps the locality group name to an ArrayList of VisibilityMetric objects. These contain the components of a visibility metric; the visibility as a String, the number of times that is seen in a locality group, the percentage of keys that contain that visibility in the locality group, the number of blocks in the locality group that contain the visibility, and the percentage of blocks in the locality group that contain the visibility.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,com.google.common.util.concurrent.AtomicLongMap<String>>blocksprotected ArrayList<String>localityGroupsprotected Map<String,com.google.common.util.concurrent.AtomicLongMap<String>>metricprotected ArrayList<Integer>numBlocksprotected ArrayList<Long>numEntries
-
Constructor Summary
Constructors Constructor Description VisMetricsGatherer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetric(Key key, Value val)Collect and store metrics for the given entry.Map<String,ArrayList<VisibilityMetric>>getMetrics()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 oneCF)Start a new LocalityGroup.
-
-
-
Method Detail
-
init
public void init(Map<String,ArrayList<ByteSequence>> cf)
Description copied from interface:MetricsGathererInitialize the gatherer when it is registered with the RFile Reader- Specified by:
initin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>- Parameters:
cf- Map of the LocalityGroup names to their column families
-
startLocalityGroup
public void startLocalityGroup(org.apache.hadoop.io.Text oneCF)
Description copied from interface:MetricsGathererStart a new LocalityGroup. This method is used when the RFile seeks to the next LocalityGroup.- Specified by:
startLocalityGroupin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>- Parameters:
oneCF- Text object of the column family of the first entry in the locality group
-
addMetric
public void addMetric(Key key, Value val)
Description copied from interface:MetricsGathererCollect and store metrics for the given entry.- Specified by:
addMetricin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>- Parameters:
key- Key object of the entry you are collecting metrics fromval- Value object of the entry you are collecting metrics from
-
startBlock
public void startBlock()
Description copied from interface:MetricsGathererStart a new block within a LocalityGroup. This method is used when the RFile moves on the the next block in the LocalityGroup.- Specified by:
startBlockin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>
-
printMetrics
public void printMetrics(boolean hash, String metricWord, PrintStream out)Description copied from interface:MetricsGathererPrint 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- Specified by:
printMetricsin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>- 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
public Map<String,ArrayList<VisibilityMetric>> getMetrics()
- Specified by:
getMetricsin interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>- Returns:
- the metrics gathered
-
-