org.apache.hadoop.mapred.lib.aggregate
Class ValueHistogram
java.lang.Object
   org.apache.hadoop.mapred.lib.aggregate.ValueHistogram
org.apache.hadoop.mapred.lib.aggregate.ValueHistogram
- All Implemented Interfaces: 
- ValueAggregator
- public class ValueHistogram 
- extends Object- implements ValueAggregator
This class implements a value aggregator that computes the 
 histogram of a sequence of strings.
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
ValueHistogram
public ValueHistogram()
addNextValue
public void addNextValue(Object val)
- add the given val to the aggregator.
 
- 
- Specified by:
- addNextValuein interface- ValueAggregator
 
- 
- Parameters:
- val- the value to be added. It is expected to be a string
 in the form of xxxx\tnum, meaning xxxx has num occurrences.
 
getReport
public String getReport()
- 
- Specified by:
- getReportin interface- ValueAggregator
 
- 
- Returns:
- the string representation of this aggregator.
 It includes the following basic statistics of the histogram:
    the number of unique values
    the minimum value
    the media value
    the maximum value
    the average value
    the standard deviation
 
getReportDetails
public String getReportDetails()
- 
 
- 
- Returns:
- a string representation of the list of value/frequence pairs of 
 the histogram
 
getCombinerOutput
public ArrayList getCombinerOutput()
- 
- Specified by:
- getCombinerOutputin interface- ValueAggregator
 
- 
- Returns:
- a list value/frequence pairs.
  The return value is expected to be used by the reducer.
 
getReportItems
public TreeMap getReportItems()
- 
 
- 
- Returns:
- a TreeMap representation of the histogram
 
reset
public void reset()
- reset the aggregator
 
- 
- Specified by:
- resetin interface- ValueAggregator
 
- 
 
Copyright © 2009 The Apache Software Foundation