Author: kennethxian
Date: Sun Jul 21 16:11:44 2013
New Revision: 1505410

URL: http://svn.apache.org/r1505410
Log:
HAMA-780: New launched child processes by fault tolerance may not be able to 
contact each other

Modified:
    hama/trunk/CHANGES.txt
    
hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java

Modified: hama/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hama/trunk/CHANGES.txt?rev=1505410&r1=1505409&r2=1505410&view=diff
==============================================================================
--- hama/trunk/CHANGES.txt (original)
+++ hama/trunk/CHANGES.txt Sun Jul 21 16:11:44 2013
@@ -6,6 +6,7 @@ Release 0.6.3 (unreleased changes)
 
   BUG FIXES
 
+   HAMA-780: New launched child processes by fault tolerance may not be able 
to contact each other (kennethxian)
    HAMA-772: When selected KeyValueTextInputFormat, workers get only one value 
for key (Ikhtiyor Ahmedov via edwardyoon)
    HAMA-776: localQueue is set as Send queue in init function of 
AbstractMessageManager (kennethxian)
    HAMA-769: Intermediate queue's close method is not called, clean work may 
be omitted (kennethxian)

Modified: 
hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
URL: 
http://svn.apache.org/viewvc/hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java?rev=1505410&r1=1505409&r2=1505410&view=diff
==============================================================================
--- 
hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
 (original)
+++ 
hama/trunk/core/src/main/java/org/apache/hama/bsp/sync/ZooKeeperSyncClientImpl.java
 Sun Jul 21 16:11:44 2013
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
 
@@ -280,6 +281,7 @@ public class ZooKeeperSyncClientImpl ext
             constructKey(taskId.getJobID(), "peers"), this);
         allPeers = var.toArray(new String[var.size()]);
 
+        TreeMap<TaskAttemptID, String> taskAttemptSortedMap = new 
TreeMap<TaskAttemptID, String>();
         for (String s : allPeers) {
           byte[] data = zk.getData(constructKey(taskId.getJobID(), "peers", s),
               this, null);
@@ -287,13 +289,17 @@ public class ZooKeeperSyncClientImpl ext
           boolean result = getValueFromBytes(data, thatTask);
 
           if (result) {
-            LOG.debug("TASK mapping from zookeeper: " + thatTask + " ID:"
-                + thatTask.getTaskID().getId() + " : " + s);
-            sortedMap.put(thatTask.getTaskID().getId(), s);
+            taskAttemptSortedMap.put(thatTask, s);
           }
-
         }
-
+        for (Map.Entry<TaskAttemptID, String> entry : taskAttemptSortedMap
+            .entrySet()) {
+          TaskAttemptID thatTask = entry.getKey();
+          String s = entry.getValue();
+          LOG.debug("TASK mapping from zookeeper: " + thatTask + " ID:"
+              + thatTask.getTaskID().getId() + " : " + s);
+          sortedMap.put(thatTask.getTaskID().getId(), s);
+        }
       } catch (Exception e) {
         LOG.error(e);
         throw new RuntimeException("All peer names could not be retrieved!");


Reply via email to