S1
- First single value typeR1
- First reduced value typeS2
- Second single value typeR2
- Second reduced value typepublic class PairReduce<S1,R1 extends org.apache.hadoop.io.Writable,S2,R2 extends org.apache.hadoop.io.Writable> extends Object implements ReduceOperation<org.apache.commons.lang3.tuple.Pair<S1,S2>,PairWritable<R1,R2>>
Constructor and Description |
---|
PairReduce()
Constructor
|
PairReduce(ReduceOperation<S1,R1> reduce1,
ReduceOperation<S2,R2> reduce2)
Constructor
|
Modifier and Type | Method and Description |
---|---|
PairWritable<R1,R2> |
createInitialValue()
Return new reduced value which is neutral to reduce operation.
|
void |
readFields(DataInput in) |
PairWritable<R1,R2> |
reduce(PairWritable<R1,R2> curValue,
org.apache.commons.lang3.tuple.Pair<S1,S2> valueToReduce)
Add a new value.
|
PairWritable<R1,R2> |
reduceMerge(PairWritable<R1,R2> curValue,
PairWritable<R1,R2> valueToReduce)
Add partially reduced value to current partially reduced value.
|
void |
write(DataOutput out) |
public PairReduce()
public PairReduce(ReduceOperation<S1,R1> reduce1, ReduceOperation<S2,R2> reduce2)
reduce1
- First reduceOpreduce2
- Second reduceOppublic PairWritable<R1,R2> createInitialValue()
ReduceOperation
createInitialValue
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<S1,S2>,PairWritable<R1 extends org.apache.hadoop.io.Writable,R2 extends org.apache.hadoop.io.Writable>>
public PairWritable<R1,R2> reduce(PairWritable<R1,R2> curValue, org.apache.commons.lang3.tuple.Pair<S1,S2> valueToReduce)
ReduceOperation
reduce
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<S1,S2>,PairWritable<R1 extends org.apache.hadoop.io.Writable,R2 extends org.apache.hadoop.io.Writable>>
curValue
- Partial value into which to reduce and store the resultvalueToReduce
- Single value to be reducedpublic PairWritable<R1,R2> reduceMerge(PairWritable<R1,R2> curValue, PairWritable<R1,R2> valueToReduce)
ReduceOperation
reduceMerge
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<S1,S2>,PairWritable<R1 extends org.apache.hadoop.io.Writable,R2 extends org.apache.hadoop.io.Writable>>
curValue
- Partial value into which to reduce and store the resultvalueToReduce
- Partial value to be reducedpublic void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.