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);
     }


Reply via email to