mapreduce,排序值

Bam*_*ylo 1 java sorting hadoop mapreduce cloudera

我的映射器有一个输出:

Mapper: KEY, VALUE(Timestamp, someOtherAttrbibutes)
Run Code Online (Sandbox Code Playgroud)

我的减速机确实收到了:

Reducer: KEY, Iterable<VALUE(Timestamp, someOtherAttrbibutes)>
Run Code Online (Sandbox Code Playgroud)

我想Iterable<VALUE(Timestamp, someOtherAttrbibutes)>Timestamp属性排序.有没有可能实现它?

我想避免在Reducer代码中手动排序.http://cornercases.wordpress.com/2011/08/18/hadoop-object-reuse-pitfall-all-my-reducer-values-are-the-same/

我将不得不从Iterable"深度复制"所有对象,这会导致巨大的内存开销.:(((

wlk*_*wlk 6

它相对容易,你需要为你的VALUE班级编写比较器课程.

仔细看看这里:http://vangjee.wordpress.com/2012/03/20/secondary-sorting-aka-sorting-values-in-hadoops-mapreduce-programming-paradigm/特别是在二级分拣部分的解决方案.