public class MasterGlobalCommHandler extends Object implements MasterGlobalCommUsage
Constructor and Description |
---|
MasterGlobalCommHandler(MasterAggregatorHandler aggregatorHandler,
MasterInputSplitsHandler inputSplitsHandler)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
broadcast(String name,
org.apache.hadoop.io.Writable value)
Broadcast given value to all workers for next computation.
|
MasterAggregatorHandler |
getAggregatorHandler() |
Iterable<PartitionStats> |
getAllPartitionStats(int numWorkers,
org.apache.hadoop.util.Progressable progressable)
Get all partition stats.
|
MasterInputSplitsHandler |
getInputSplitsHandler() |
<R extends org.apache.hadoop.io.Writable> |
getReduced(String name)
Get reduced value from previous worker computation.
|
void |
receivedPartitionStats(List<PartitionStats> partitionStats)
Received partition stats from a worker
|
<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.
|
public MasterGlobalCommHandler(MasterAggregatorHandler aggregatorHandler, MasterInputSplitsHandler inputSplitsHandler)
aggregatorHandler
- Aggregator handlerinputSplitsHandler
- Input splits handlerpublic MasterAggregatorHandler getAggregatorHandler()
public MasterInputSplitsHandler getInputSplitsHandler()
public <S,R extends org.apache.hadoop.io.Writable> void registerReducer(String name, ReduceOperation<S,R> reduceOp)
MasterGlobalCommUsageAggregators
registerReducer
in interface MasterGlobalCommUsageAggregators
S
- 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)
MasterGlobalCommUsageAggregators
registerReducer
in interface MasterGlobalCommUsageAggregators
S
- Single value typeR
- Reduced value typename
- Name of the reducerreduceOp
- Reduce operationsglobalInitialValue
- Global initial valuepublic <R extends org.apache.hadoop.io.Writable> R getReduced(String name)
MasterGlobalCommUsageAggregators
getReduced
in interface MasterGlobalCommUsageAggregators
R
- Reduced value typename
- Name of the reducerpublic void broadcast(String name, org.apache.hadoop.io.Writable value)
MasterGlobalCommUsageAggregators
broadcast
in interface MasterGlobalCommUsageAggregators
name
- Name of the broadcast objectvalue
- Valuepublic void receivedPartitionStats(List<PartitionStats> partitionStats)
partitionStats
- Partition statspublic Iterable<PartitionStats> getAllPartitionStats(int numWorkers, org.apache.hadoop.util.Progressable progressable)
numWorkers
- Number of workers to wait forprogressable
- Progressable to report progress toCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.