You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by Apache Wiki <wi...@apache.org> on 2010/11/08 07:17:47 UTC

[Hama Wiki] Trivial Update of "SerializePrinting" by edwardyoon

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hama Wiki" for change notification.

The "SerializePrinting" page has been changed by edwardyoon.
http://wiki.apache.org/hama/SerializePrinting?action=diff&rev1=8&rev2=9

--------------------------------------------------

  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.
  
-  * Each task gets its own hostname (hostname:port pair) and a sorted list containing the hostnames of all the other peers
+  * Each task gets its own hostname (hostname:port pair) and a sorted list containing the hostnames of all the other peers.
-  * Each task prints the LOG string "Hello BSP" only when its turn comes
+  * Each task prints the LOG string "Hello BSP" only when its turn comes at intervals of 5 seconds.
  
  === Sequence Diagram ===
  
@@ -22, +22 @@

    public static class HelloBSP extends BSP {
      public static final Log LOG = LogFactory.getLog(HelloBSP.class);
      private Configuration conf;
+     private final static int PRINT_INTERVAL = 5000;
  
      @Override
      public void bsp(BSPPeer bspPeer) throws IOException, KeeperException,
@@ -35, +36 @@

                + bspPeer.getPeerName());
          }
          
-         Thread.sleep(200);
+         Thread.sleep(PRINT_INTERVAL);
          bspPeer.sync();
          i++;
        }