incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1208054 - /incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java
Date Tue, 29 Nov 2011 20:23:16 GMT
Author: tommaso
Date: Tue Nov 29 20:23:15 2011
New Revision: 1208054

URL: http://svn.apache.org/viewvc?rev=1208054&view=rev
Log:
[HAMA-482] - InetSocketAddress is initialized first by peerName and then used accordingly
with localOutgoingMessages

Modified:
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java?rev=1208054&r1=1208053&r2=1208054&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java Tue Nov
29 20:23:15 2011
@@ -328,17 +328,16 @@ public class LocalBSPRunner implements J
 
     @Override
     public void send(String peerName, BSPMessage msg) throws IOException {
-      LinkedList<BSPMessage> msgs = localOutgoingMessages.get(peerName);
-      if (msgs == null) {
-        msgs = new LinkedList<BSPMessage>();
-      }
-      msgs.add(msg);
-
       InetSocketAddress inetSocketAddress = socketCache.get(peerName);
       if (inetSocketAddress == null) {
         inetSocketAddress = BSPNetUtils.getAddress(peerName);
         socketCache.put(peerName, inetSocketAddress);
       }
+      LinkedList<BSPMessage> msgs = localOutgoingMessages.get(inetSocketAddress);
+      if (msgs == null) {
+        msgs = new LinkedList<BSPMessage>();
+      }
+      msgs.add(msg);
 
       localOutgoingMessages.put(inetSocketAddress, msgs);
     }



Mime
View raw message