[ 
https://issues.apache.org/jira/browse/HAMA-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424958#comment-13424958
 ] 

Suraj Menon commented on HAMA-515:
----------------------------------

I believe this could be a separate feature or Counter type defined. 
With the changes in HAMA-587, this could be achieved with few function calls. 
as shown below.
{code}

   ZKSyncClient.storeInformation("/bsp/job_id/COUNTER_NAME/taskId", new 
IntWritable(value));

   peer.sync()
   
   String[] childKeySet = 
ZKSyncClient.getChildKeySet("/bsp/job_id/COUNTER_NAME");

   int counterValue = 0;
   IntWritable valueHolder = new IntWritable();

   for (String key: childKeySet){
       if(ZKSyncClient.getInformation(key, valueHolder){
          counterValue += valueHolder.get();
       }
   }

   // counterValue is now the sum of all the values in all peers for the 
Counter.

{code}

We should not use Zookeeper for all counters, hence the request for these 
counters as a separate genre/feature of Counters.




                
> Counter should be synchronized by sync()
> ----------------------------------------
>
>                 Key: HAMA-515
>                 URL: https://issues.apache.org/jira/browse/HAMA-515
>             Project: Hama
>          Issue Type: New Feature
>    Affects Versions: 0.5.0
>            Reporter: Thomas Jungblut
>            Priority: Minor
>             Fix For: 0.6.0
>
>         Attachments: HAMA-515.patch
>
>
> We should synchronize the counters in all tasks after a sync() call. 
> Then someone can use it for flow control. E.G. graph related algorithms, to 
> get the number of globally updated vertices.
> Two options to solve this:
>  - Sync the whole stuff over RPC from the BSPMaster
>  - Use Zookeeper for counter handling

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to