S
- Single value type, objects passed on workersR
- Reduced value typepublic class Reducer<S,R extends org.apache.hadoop.io.Writable> extends Object
Constructor and Description |
---|
Reducer()
Constructor
|
Reducer(ReduceOperation<S,R> reduceOp)
Constructor
|
Reducer(ReduceOperation<S,R> reduceOp,
R currentValue)
Constructor
|
Modifier and Type | Method and Description |
---|---|
R |
createInitialValue()
Return new initial reduced value.
|
R |
getCurrentValue() |
ReduceOperation<S,R> |
getReduceOp() |
void |
readFields(DataInput in,
ImmutableClassesGiraphConfiguration conf)
Deserialize the fields of this object from
in . |
void |
reduce(S valueToReduce)
Reduce given value into current reduced value.
|
void |
reduceMerge(R valueToReduce)
Reduce given partially reduced value into current reduced value.
|
void |
setCurrentValue(R currentValue) |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
public Reducer()
public Reducer(ReduceOperation<S,R> reduceOp)
reduceOp
- Reduce operationspublic Reducer(ReduceOperation<S,R> reduceOp, R currentValue)
reduceOp
- Reduce operationscurrentValue
- current reduced valuepublic void reduce(S valueToReduce)
valueToReduce
- Single value to reducepublic void reduceMerge(R valueToReduce)
valueToReduce
- Partial value to reducepublic R createInitialValue()
public ReduceOperation<S,R> getReduceOp()
public R getCurrentValue()
public void setCurrentValue(R currentValue)
public void write(DataOutput out) throws IOException
out
.out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in, ImmutableClassesGiraphConfiguration conf) throws IOException
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
in
- DataInput
to deseriablize this object from.conf
- ConfigurationIOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.