Each BSP task of the HAMA cluster, will print the string "Hello BSP" in serial order. This example will help you to understand the concepts of the BSP computing model.
public void bsp(BSPPeerProtocol bspPeer) throws IOException, KeeperException, InterruptedException { int i = 0; for (String otherPeer : bspPeer.getAllPeerNames()) { String peerName = bspPeer.getPeerName(); if (peerName.equals(otherPeer)) { writeLogToFile(peerName, i); } Thread.sleep(PRINT_INTERVAL); bspPeer.sync(); i++; } } |