org.apache.accumulo.examples.simple.combiner
Class StatsCombiner
java.lang.Object
org.apache.accumulo.core.iterators.WrappingIterator
org.apache.accumulo.core.iterators.Combiner
org.apache.accumulo.examples.simple.combiner.StatsCombiner
- All Implemented Interfaces:
- OptionDescriber, SortedKeyValueIterator<Key,Value>
public class StatsCombiner
- extends Combiner
This combiner calculates the max, min, sum, and count of long integers represented as strings in values. It stores the result in a comma-separated value of
the form max,min,sum,count. If such a value is encountered while combining, its information is incorporated into the running calculations of max, min, sum,
and count. See Combiner for more information on which values are combined together. See docs/examples/README.combiner for instructions.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RADIX_OPTION
public static final String RADIX_OPTION
- See Also:
- Constant Field Values
StatsCombiner
public StatsCombiner()
reduce
public Value reduce(Key key,
Iterator<Value> iter)
- Specified by:
reduce in class Combiner
init
public void init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
IteratorEnvironment env)
throws IOException
- Specified by:
init in interface SortedKeyValueIterator<Key,Value>- Overrides:
init in class Combiner
- Throws:
IOException
describeOptions
public OptionDescriber.IteratorOptions describeOptions()
- Specified by:
describeOptions in interface OptionDescriber- Overrides:
describeOptions in class Combiner
validateOptions
public boolean validateOptions(Map<String,String> options)
- Specified by:
validateOptions in interface OptionDescriber- Overrides:
validateOptions in class Combiner
setRadix
public static void setRadix(IteratorSetting iterConfig,
int base)
- A convenience method for setting the expected base/radix of the numbers
- Parameters:
iterConfig - Iterator settings to configurebase - The expected base/radix of the numbers.
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.