public class MasterAggregatorHandler extends Object implements MasterGlobalCommUsageAggregators, org.apache.hadoop.io.Writable
| Constructor and Description |
|---|
MasterAggregatorHandler(ImmutableClassesGiraphConfiguration<?,?,?> conf,
org.apache.hadoop.util.Progressable progressable)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptReducedValues(DataInput reducedValuesInput)
Accept reduced values sent by worker.
|
void |
broadcast(String name,
org.apache.hadoop.io.Writable object)
Broadcast given value to all workers for next computation.
|
void |
close()
Close
AggregatorWriter |
void |
finishSuperstep()
Finalize aggregators for current superstep
|
<T extends org.apache.hadoop.io.Writable> |
getReduced(String name)
Get reduced value from previous worker computation.
|
void |
initialize(BspService service)
Initialize
AggregatorWriter |
void |
prepareSuperstep()
Prepare reduced values for current superstep's master compute
|
void |
readFields(DataInput in) |
<S,R extends org.apache.hadoop.io.Writable> |
registerReducer(String name,
ReduceOperation<S,R> reduceOp)
Register reducer to be reduced in the next worker computation,
using given name and operations.
|
<S,R extends org.apache.hadoop.io.Writable> |
registerReducer(String name,
ReduceOperation<S,R> reduceOp,
R globalInitialValue)
Register reducer to be reduced in the next worker computation, using
given name and operations, starting globally from globalInitialValue.
|
void |
sendDataToOwners(MasterClient masterClient)
Send data to workers (through owner workers)
|
void |
write(DataOutput out) |
void |
writeAggregators(long superstep,
SuperstepState superstepState)
Write aggregators to
AggregatorWriter |
public MasterAggregatorHandler(ImmutableClassesGiraphConfiguration<?,?,?> conf, org.apache.hadoop.util.Progressable progressable)
conf - Configurationprogressable - Progress reporterpublic final <S,R extends org.apache.hadoop.io.Writable> void registerReducer(String name, ReduceOperation<S,R> reduceOp)
MasterGlobalCommUsageAggregatorsregisterReducer in interface MasterGlobalCommUsageAggregatorsS - Single value typeR - Reduced value typename - Name of the reducerreduceOp - Reduce operationspublic <S,R extends org.apache.hadoop.io.Writable> void registerReducer(String name, ReduceOperation<S,R> reduceOp, R globalInitialValue)
MasterGlobalCommUsageAggregatorsregisterReducer in interface MasterGlobalCommUsageAggregatorsS - Single value typeR - Reduced value typename - Name of the reducerreduceOp - Reduce operationsglobalInitialValue - Global initial valuepublic <T extends org.apache.hadoop.io.Writable> T getReduced(String name)
MasterGlobalCommUsageAggregatorsgetReduced in interface MasterGlobalCommUsageAggregatorsT - Reduced value typename - Name of the reducerpublic void broadcast(String name, org.apache.hadoop.io.Writable object)
MasterGlobalCommUsageAggregatorsbroadcast in interface MasterGlobalCommUsageAggregatorsname - Name of the broadcast objectobject - Valuepublic void prepareSuperstep()
public void finishSuperstep()
public void sendDataToOwners(MasterClient masterClient)
masterClient - IPC client on masterpublic void acceptReducedValues(DataInput reducedValuesInput) throws IOException
reducedValuesInput - Input in which aggregated values are
written in the following format:
numReducers
name_1 REDUCED_VALUE value_1
name_2 REDUCED_VALUE value_2
...IOExceptionpublic void writeAggregators(long superstep,
SuperstepState superstepState)
AggregatorWritersuperstep - Superstep which just finishedsuperstepState - State of the superstep which just finishedpublic void initialize(BspService service)
AggregatorWriterservice - BspServicepublic void close()
throws IOException
AggregatorWriterIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.