Class LongCombiner
java.lang.Object
org.apache.accumulo.core.iterators.WrappingIterator
org.apache.accumulo.core.iterators.Combiner
org.apache.accumulo.core.iterators.TypedValueCombiner<Long>
org.apache.accumulo.core.iterators.LongCombiner
- All Implemented Interfaces:
- OptionDescriber,- SortedKeyValueIterator<Key,,- Value> - YieldingKeyValueIterator<Key,- Value> 
- Direct Known Subclasses:
- MaxCombiner,- MinCombiner,- SummingCombiner
A TypedValueCombiner that translates each Value to a Long before reducing, then encodes the
 reduced Long back to a Value.
 Subclasses must implement a typedReduce method:
 
public Long typedReduce(Key key, Iterator<Long> iter);
 This typedReduce method will be passed the most recent Key and an iterator over the Values
 (translated to Longs) for all non-deleted versions of that Key.
 A required option for this Combiner is "type" which indicates which type of Encoder to use to
 encode and decode Longs into Values. Supported types are VARLEN, FIXEDLEN, and STRING which
 indicate the VarLenEncoder, FixedLenEncoder, and StringEncoder respectively.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAn Encoder that uses an 8-byte encoding for Longs.static classAn Encoder that uses a String representation of Longs.static enumstatic classAn Encoder that uses a variable-length encoding for Longs.Nested classes/interfaces inherited from class org.apache.accumulo.core.iterators.CombinerCombiner.ValueIteratorNested classes/interfaces inherited from interface org.apache.accumulo.core.iterators.OptionDescriberOptionDescriber.IteratorOptions
- 
Field SummaryFieldsFields inherited from class org.apache.accumulo.core.iterators.TypedValueCombinerLOSSYFields inherited from class org.apache.accumulo.core.iterators.CombinerALL_OPTION, COLUMNS_OPTION, REDUCE_ON_FULL_COMPACTION_ONLY_OPTION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionGets an iterator options object that contains information needed to configure this iterator.voidinit(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) Initializes the iterator.static longsafeAdd(long a, long b) static voidsetEncodingType(IteratorSetting is, Class<? extends Encoder<Long>> encoderClass) A convenience method for setting the long encoding type.static voidsetEncodingType(IteratorSetting is, String encoderClassName) A convenience method for setting the long encoding type.static voidsetEncodingType(IteratorSetting is, LongCombiner.Type type) A convenience method for setting the long encoding type.booleanvalidateOptions(Map<String, String> options) Check to see if an options map contains all options required by an iterator and that the option values are in the expected formats.Methods inherited from class org.apache.accumulo.core.iterators.TypedValueCombinerdeepCopy, reduce, setEncoder, setEncoder, setLossyness, testEncoder, testEncoder, typedReduceMethods inherited from class org.apache.accumulo.core.iterators.CombinergetTopKey, getTopValue, hasTop, next, seek, setColumns, setCombineAllColumns, setReduceOnFullCompactionOnlyMethods inherited from class org.apache.accumulo.core.iterators.WrappingIteratorgetSource, isRunningLowOnMemory, setSourceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.accumulo.core.iterators.YieldingKeyValueIteratorenableYielding
- 
Field Details- 
FIXED_LEN_ENCODER
- 
VAR_LEN_ENCODER
- 
STRING_ENCODER
- 
TYPE- See Also:
 
- 
CLASS_PREFIX- See Also:
 
 
- 
- 
Constructor Details- 
LongCombinerpublic LongCombiner()
 
- 
- 
Method Details- 
initpublic void init(SortedKeyValueIterator<Key, Value> source, Map<String, throws IOExceptionString> options, IteratorEnvironment env) Description copied from interface:SortedKeyValueIteratorInitializes the iterator. Data should not be read from the source in this method.- Specified by:
- initin interface- SortedKeyValueIterator<Key,- Value> 
- Overrides:
- initin class- TypedValueCombiner<Long>
- Parameters:
- source-- SortedKeyValueIteratorsource to read data from.
- options-- Mapmap of string option names to option values.
- env-- IteratorEnvironmentenvironment in which iterator is being run, provided by Accumulo itself and is expected to be non-null.
- Throws:
- IOException- unused.
 
- 
describeOptionsDescription copied from interface:OptionDescriberGets an iterator options object that contains information needed to configure this iterator. This object will be used by the accumulo shell to prompt the user to input the appropriate information.- Specified by:
- describeOptionsin interface- OptionDescriber
- Overrides:
- describeOptionsin class- TypedValueCombiner<Long>
- Returns:
- an iterator options object
 
- 
validateOptionsDescription copied from interface:OptionDescriberCheck to see if an options map contains all options required by an iterator and that the option values are in the expected formats.- Specified by:
- validateOptionsin interface- OptionDescriber
- Overrides:
- validateOptionsin class- TypedValueCombiner<Long>
- Parameters:
- options- a map of option names to option values
- Returns:
- true if options are valid, false otherwise (IllegalArgumentException preferred)
 
- 
safeAddpublic static long safeAdd(long a, long b) 
- 
setEncodingTypeA convenience method for setting the long encoding type.- Parameters:
- is- IteratorSetting object to configure.
- type- LongCombiner.Type specifying the encoding type.
 
- 
setEncodingTypeA convenience method for setting the long encoding type.- Parameters:
- is- IteratorSetting object to configure.
- encoderClass-- Class<? extends Encoder<Long>>specifying the encoding type.
 
- 
setEncodingTypeA convenience method for setting the long encoding type.- Parameters:
- is- IteratorSetting object to configure.
- encoderClassName- name of a class specifying the encoding type.
 
 
-