public class WorkerAggregatorHandler.ThreadLocalWorkerGlobalCommUsage extends Object implements WorkerThreadGlobalCommUsage
WorkerThreadGlobalCommUsage
.
We can use one instance of this object per thread to prevent
synchronizing on each aggregate() call. In the end of superstep,
values from each of these will be aggregated back to WorkerThreadGlobalCommUsage
Constructor and Description |
---|
ThreadLocalWorkerGlobalCommUsage()
Constructor
Creates new instances of all reducers from
WorkerAggregatorHandler |
Modifier and Type | Method and Description |
---|---|
void |
finishThreadComputation()
Call this after thread's computation is finished,
i.e.
|
<B extends org.apache.hadoop.io.Writable> |
getBroadcast(String name)
Get value broadcasted from master
|
void |
reduce(String name,
Object value)
Reduce given value.
|
void |
reduceMerge(String name,
org.apache.hadoop.io.Writable value)
Reduce given partial value.
|
public ThreadLocalWorkerGlobalCommUsage()
WorkerAggregatorHandler
public void reduce(String name, Object value)
WorkerReduceUsage
reduce
in interface WorkerReduceUsage
name
- Name of the reducervalue
- Single value to reducepublic void reduceMerge(String name, org.apache.hadoop.io.Writable value)
WorkerReduceUsage
reduceMerge
in interface WorkerReduceUsage
name
- Name of the reducervalue
- Single value to reducepublic <B extends org.apache.hadoop.io.Writable> B getBroadcast(String name)
WorkerBroadcastUsage
getBroadcast
in interface WorkerBroadcastUsage
B
- Broadcast value typename
- Name of the broadcasted valuepublic void finishThreadComputation()
WorkerThreadGlobalCommUsage
finishThreadComputation
in interface WorkerThreadGlobalCommUsage
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.