[转载]Hadoop Streaming 实战: aggregate
http://blog.csdn.net/yfkiss/article/details/70190222. aggregate class summary
DoubleValueSumThis class implements a value aggregator that sums up a sequence of double values.LongValueMaxThis class implements a value aggregator that maintain the maximum of a sequence of long values.LongValueMinThis class implements a value aggregator that maintain the minimum of a sequence of long values.LongValueSumThis class implements a value aggregator that sums up a sequence of long values.StringValueMaxThis class implements a value aggregator that maintain the biggest of a sequence of strings.StringValueMinThis class implements a value aggregator that maintain the smallest of a sequence of strings.UniqValueCountThis class implements a value aggregator that dedupes a sequence of objects.UserDefinedValueAggregatorDescriptorThis class implements a wrapper for a user defined value aggregator descriptor.ValueAggregatorBaseDescriptorThis class implements the common functionalities of the subclasses of ValueAggregatorDescriptor class.ValueAggregatorCombiner<K1 extends WritableComparable,V1 extends Writable>This class implements the generic combiner of Aggregate.ValueAggregatorJobThis is the main class for creating a map/reduce job using Aggregate framework.ValueAggregatorJobBase<K1 extends WritableComparable,V1 extends Writable>This abstract class implements some common functionalities of the the generic mapper, reducer and combiner classes of Aggregate.ValueAggregatorMapper<K1 extends WritableComparable,V1 extends Writable>This class implements the generic mapper of Aggregate.ValueAggregatorReducer<K1 extends WritableComparable,V1 extends Writable>This class implements the generic reducer of Aggregate.ValueHistogramThis class implements a value aggregator that computes the histogram of a sequence of strings 3. streaming中使用aggregate
在mapper任务的输出中添加控制,如下:
function:key\tvalue
eg:
LongValueSum:key\tvalue
此外,置-reducer = aggregate。此时,Reducer使用aggregate中对应的function类对相同key的value进行操作,例如,设置function为LongValueSum则将对每个键值对应的value求和。
页:
[1]