hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r950906 - in /incubator/hama/trunk: ./ src/java/org/apache/hama/bsp/ src/java/org/apache/hama/util/ src/test/org/apache/hama/bsp/
Date Thu, 03 Jun 2010 08:02:14 GMT
Author: edwardyoon
Date: Thu Jun  3 08:02:13 2010
New Revision: 950906

URL: http://svn.apache.org/viewvc?rev=950906&view=rev
Log:
Add getter for serverName to BSPPeerInterface

Removed:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/DefaultBSPPeer.java
Modified:
    incubator/hama/trunk/CHANGES.txt
    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/util/ClusterUtil.java
    incubator/hama/trunk/src/test/org/apache/hama/bsp/UserInterface.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=950906&r1=950905&r2=950906&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Thu Jun  3 08:02:13 2010
@@ -43,6 +43,7 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    HAMA-269: Add getter for serverName to BSPPeerInterface (edwardyoon)
     HAMA-257: Design BSP program code interface (edwardyoon)
     HAMA-261: Remove meaningless unit tests (edwardyoon)
     HAMA-253: Change the blog link url (edwardyoon)

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=950906&r1=950905&r2=950906&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 Thu Jun  3 08:02:13 2010
@@ -39,7 +39,7 @@ import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooDefs.Ids;
 
-public class BSPPeer implements DefaultBSPPeer, Watcher, BSPPeerInterface {
+public class BSPPeer implements Watcher, BSPPeerInterface {
   public static final Log LOG = LogFactory.getLog(BSPPeer.class);
 
   protected Configuration conf;
@@ -79,7 +79,7 @@ public class BSPPeer implements DefaultB
 
   public void reinitialize() {
     try {
-      System.out.println(bindAddress + ":" + bindPort);
+      LOG.debug("reinitialize(): " + bindAddress + ":" + bindPort);
       server = RPC.getServer(this, bindAddress, bindPort, conf);
       server.start();
     } catch (IOException e) {
@@ -237,4 +237,9 @@ public class BSPPeer implements DefaultB
 
     return peer;
   }
+
+  @Override
+  public String getServerName() {
+    return this.serverName;
+  }
 }

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=950906&r1=950905&r2=950906&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 Thu Jun  3 08:02:13
2010
@@ -17,10 +17,44 @@
  */
 package org.apache.hama.bsp;
 
+import java.io.Closeable;
 import java.io.IOException;
+import java.net.InetSocketAddress;
+
+import org.apache.hama.Constants;
+import org.apache.zookeeper.KeeperException;
+
+public interface BSPPeerInterface extends BSPRPCProtocolVersion, Closeable, Constants {
+
+  /**
+   * Send a data with a tag to another BSPSlave corresponding to hostname.
+   * Messages sent by this method are not guaranteed to be received in a sent
+   * order.
+   * 
+   * @param hostname
+   * @param msg
+   * @throws IOException
+   */
+  public void send(InetSocketAddress hostname, BSPMessage msg)
+      throws IOException;
 
-public interface BSPPeerInterface extends BSPRPCProtocolVersion {
   public void put(BSPMessage msg) throws IOException;
+  
+  /**
+   * @return the current message
+   * @throws IOException
+   */
+  public BSPMessage getCurrentMessage() throws IOException;
 
+  /**
+   * Synchronize all of the data in the local queue to other BSP Peers.
+   * 
+   * @throws InterruptedException
+   * @throws KeeperException
+   */
+  public void sync() throws IOException, KeeperException, InterruptedException;
+  
   public boolean isRunning();
+  
+  public String getServerName();
 }

Modified: incubator/hama/trunk/src/java/org/apache/hama/util/ClusterUtil.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/util/ClusterUtil.java?rev=950906&r1=950905&r2=950906&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/util/ClusterUtil.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/util/ClusterUtil.java Thu Jun  3 08:02:13
2010
@@ -3,7 +3,6 @@ package org.apache.hama.util;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hama.bsp.BSPMaster;
 import org.apache.hama.bsp.GroomServer;

Modified: incubator/hama/trunk/src/test/org/apache/hama/bsp/UserInterface.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/bsp/UserInterface.java?rev=950906&r1=950905&r2=950906&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/bsp/UserInterface.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/bsp/UserInterface.java Thu Jun  3 08:02:13
2010
@@ -73,7 +73,7 @@ public class UserInterface extends HamaC
       }
 
       if (pi != 0.0)
-        System.out.println(pi);
+        System.out.println(peer.getServerName() + ": " + pi);
     }
   }
 



Mime
View raw message