Hi Jimmy, The unconsumed messages are automatically removed from the queue for next superstep. That's why getNumCurrentMessages() returns only 5.
We're thinking about adding persistent queue - https://issues.apache.org/jira/browse/HAMA-734 Hope this helps. On Fri, Dec 20, 2013 at 4:11 PM, Jimmy Ong <[email protected]> wrote: > Hi, > > I'm new to Hama and have a seemingly dumb question: > > Suppose I only have a single BSP task, why does the following code result in > having only 5 messages received by peerId? > > for(int i=0; j<5; i++) { > > for(int j=0; j<5; j++) { > peer.send(peerId, new IntWritable(1)); > } > peer.sync(); > > } > > Even though the system reported as having 25 messages sent and received, > peerId.getNumCurrentMessages() returns 5. > Also, why is the total number of supersteps 4 and not 5 (this is running in > local mode, distributed is fine)? > > Am I missing something here? > Please kindly advise. > > Thanks. > > > 13/12/20 15:03:30 INFO bsp.BSPJobClient: Current supersteps number: 4 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: The total number of supersteps: 4 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: Counters: 7 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: > org.apache.hama.bsp.JobInProgress$JobCounter > 13/12/20 15:03:30 INFO bsp.BSPJobClient: SUPERSTEPS=4 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: LAUNCHED_TASKS=1 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: > org.apache.hama.bsp.BSPPeerImpl$PeerCounter > 13/12/20 15:03:30 INFO bsp.BSPJobClient: SUPERSTEP_SUM=5 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: TIME_IN_SYNC_MS=0 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: TOTAL_MESSAGES_SENT=25 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: TOTAL_MESSAGES_RECEIVED=25 > 13/12/20 15:03:30 INFO bsp.BSPJobClient: TASK_OUTPUT_RECORDS=1 -- Best Regards, Edward J. Yoon @eddieyoon
