You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2011/02/22 05:21:45 UTC

svn commit: r1073221 - in /incubator/hama/trunk/src/java/org/apache/hama/bsp: BSPPeer.java BSPPeerInterface.java QueueManager.java

Author: edwardyoon
Date: Tue Feb 22 04:21:44 2011
New Revision: 1073221

URL: http://svn.apache.org/viewvc?rev=1073221&view=rev
Log:
Add few comments.

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeerInterface.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/QueueManager.java

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java?rev=1073221&r1=1073220&r2=1073221&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java Tue Feb 22 04:21:44 2011
@@ -203,6 +203,7 @@ public class BSPPeer implements Watcher,
 
         if (list.size() < jobConf.getNumBspTask()) {
           mutex.wait();
+          Thread.sleep(10);
         } else {
           return true;
         }
@@ -218,6 +219,7 @@ public class BSPPeer implements Watcher,
         List<String> list = zk.getChildren(bspRoot, true);
         if (list.size() > 0) {
           mutex.wait();
+          Thread.sleep(10);
         } else {
           LOG.debug("[" + getPeerName() + "] leave from the leaveBarrier");
           return true;

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeerInterface.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeerInterface.java?rev=1073221&r1=1073220&r2=1073221&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeerInterface.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeerInterface.java Tue Feb 22 04:21:44 2011
@@ -23,7 +23,8 @@ import java.io.IOException;
 import org.apache.hama.Constants;
 import org.apache.zookeeper.KeeperException;
 
-public interface BSPPeerInterface extends BSPRPCProtocolVersion, Closeable, Constants {
+public interface BSPPeerInterface extends BSPRPCProtocolVersion, Closeable,
+    Constants {
 
   /**
    * Send a data with a tag to another BSPSlave corresponding to hostname.
@@ -34,11 +35,16 @@ public interface BSPPeerInterface extend
    * @param msg
    * @throws IOException
    */
-  public void send(String peerName, BSPMessage msg)
-      throws IOException;
+  public void send(String peerName, BSPMessage msg) throws IOException;
 
+  /**
+   * Puts a message to local queue.
+   * 
+   * @param msg
+   * @throws IOException
+   */
   public void put(BSPMessage msg) throws IOException;
-  
+
   /**
    * @return A message from the peer's received messages queue (a FIFO).
    * @throws IOException
@@ -51,7 +57,10 @@ public interface BSPPeerInterface extend
   public int getNumCurrentMessages();
 
   /**
-   * Sends all the messages in the outgoing message queues to the corresponding remote peers.
+   * Barrier Synchronization.
+   * 
+   * Sends all the messages in the outgoing message queues to the corresponding
+   * remote peers.
    * 
    * @throws InterruptedException
    * @throws KeeperException
@@ -62,17 +71,18 @@ public interface BSPPeerInterface extend
    * @return the count of current super-step
    */
   public long getSuperstepCount();
-  
+
   /**
    * @return The name of this peer in the format "hostname:port".
    */
   public String getPeerName();
-  
+
   /**
-   * @return The names of all the peers executing tasks from the same job (including this peer).
+   * @return The names of all the peers executing tasks from the same job
+   *         (including this peer).
    */
   public String[] getAllPeerNames();
-  
+
   /**
    * Clears all queues entries.
    */

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/QueueManager.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/QueueManager.java?rev=1073221&r1=1073220&r2=1073221&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/QueueManager.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/QueueManager.java Tue Feb 22 04:21:44 2011
@@ -15,7 +15,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.hama.bsp;
 
 import java.io.IOException;