-Re: upgrade from 1.3 to 1.4
Aaron Cordova 2012-01-03, 17:56
Ahh that's awesome. So the function returns exactly one value for each key?
On Jan 3, 2012, at 12:53 PM, Billie J Rinaldi wrote:
> On Tuesday, January 3, 2012 11:56:50 AM, "Aaron Cordova" <[EMAIL PROTECTED]> wrote:
>> BTW I love the label 'Combiner' instead of aggregator. I've been
>> describing their capabilities as equivalent to MapReduce combiners to
>> new Accumulo users, so this makes it even more clear.
>> Are they easier to code up too? It'd be sweet if one could basically
>> just define a function such as
>> public void combine(Key k, Iterator<Value> v)
>> or some such simple signature
> That's basically it. Here's the method you implement:
> public Value reduce(Key k, Iterator<Value> v);
> We've also done something exciting with the TypedValueCombiner<V>. It uses an Encoder<V> which has decode and encode methods to translate from a Value's byte array to type V and back. Then you implement this method to do the combining:
> public V typedReduce(Key k, Iterator<V> v);
> We provide a LongCombiner which is a TypedValueCombiner<Long> with three built-in encoding types: STRING, VARLEN, and FIXEDLEN. Separating the encoding from the combining has made writing new combiners really easy. See the MaxCombiner and MinCombiner in addition to the SummingCombiner.