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>>
blocks
protected ArrayList<String>
localityGroups
protected Map<String,com.google.common.util.concurrent.AtomicLongMap<String>>
metric
protected ArrayList<Integer>
numBlocks
protected ArrayList<Long>
numEntries
-
Constructor Summary
Constructors Constructor Description VisMetricsGatherer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetric(Key key, Value val)
Collect and store metrics for the given entry.Map<String,ArrayList<VisibilityMetric>>
getMetrics()
void
init(Map<String,ArrayList<ByteSequence>> cf)
Initialize the gatherer when it is registered with the RFile Readervoid
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 blocksvoid
startBlock()
Start a new block within a LocalityGroup.void
startLocalityGroup(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:MetricsGatherer
Initialize the gatherer when it is registered with the RFile Reader- Specified by:
init
in 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:MetricsGatherer
Start a new LocalityGroup. This method is used when the RFile seeks to the next LocalityGroup.- Specified by:
startLocalityGroup
in 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:MetricsGatherer
Collect and store metrics for the given entry.- Specified by:
addMetric
in 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:MetricsGatherer
Start a new block within a LocalityGroup. This method is used when the RFile moves on the the next block in the LocalityGroup.- Specified by:
startBlock
in interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>
-
printMetrics
public void printMetrics(boolean hash, String metricWord, PrintStream out)
Description copied from interface:MetricsGatherer
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- Specified by:
printMetrics
in 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:
getMetrics
in interfaceMetricsGatherer<Map<String,ArrayList<VisibilityMetric>>>
- Returns:
- the metrics gathered
-
-