public class WorkerAggregatorHandler extends Object implements WorkerThreadGlobalCommUsage
| Modifier and Type | Class and Description | 
|---|---|
class  | 
WorkerAggregatorHandler.ThreadLocalWorkerGlobalCommUsage
Not thread-safe implementation of  
WorkerThreadGlobalCommUsage. | 
| Constructor and Description | 
|---|
WorkerAggregatorHandler(CentralizedServiceWorker<?,?,?> serviceWorker,
                       ImmutableClassesGiraphConfiguration conf,
                       org.apache.hadoop.util.Progressable progressable)
Constructor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
finishSuperstep(WorkerAggregatorRequestProcessor requestProcessor)
Send aggregators to their owners and in the end to the master 
 | 
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 
 | 
Set<Integer> | 
getOtherWorkerIdsSet()
Get set of all worker task ids except the current one 
 | 
WorkerThreadGlobalCommUsage | 
newThreadAggregatorUsage()
Create new aggregator usage which will be used by one of the compute
 threads. 
 | 
void | 
prepareSuperstep(WorkerAggregatorRequestProcessor requestProcessor)
Prepare aggregators for current superstep 
 | 
void | 
reduce(String name,
      Object value)
Reduce given value. 
 | 
void | 
reduceMerge(String name,
           org.apache.hadoop.io.Writable valueToReduce)
Combine partially reduced value into currently reduced value. 
 | 
public WorkerAggregatorHandler(CentralizedServiceWorker<?,?,?> serviceWorker, ImmutableClassesGiraphConfiguration conf, org.apache.hadoop.util.Progressable progressable)
serviceWorker - Service workerconf - Giraph configurationprogressable - Progressable for reporting progresspublic <B extends org.apache.hadoop.io.Writable> B getBroadcast(String name)
WorkerBroadcastUsagegetBroadcast in interface WorkerBroadcastUsageB - Broadcast value typename - Name of the broadcasted valuepublic void reduce(String name, Object value)
WorkerReduceUsagereduce in interface WorkerReduceUsagename - Name of the reducervalue - Single value to reducepublic void reduceMerge(String name, org.apache.hadoop.io.Writable valueToReduce)
reduceMerge in interface WorkerReduceUsagename - Name of the reducervalueToReduce - Partial value to reducepublic void prepareSuperstep(WorkerAggregatorRequestProcessor requestProcessor)
requestProcessor - Request processor for aggregatorspublic void finishSuperstep(WorkerAggregatorRequestProcessor requestProcessor)
requestProcessor - Request processor for aggregatorspublic WorkerThreadGlobalCommUsage newThreadAggregatorUsage()
public void finishThreadComputation()
WorkerThreadGlobalCommUsagefinishThreadComputation in interface WorkerThreadGlobalCommUsageCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.