hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r791731 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobTracker.java src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java
Date Tue, 07 Jul 2009 07:28:56 GMT
Author: yhemanth
Date: Tue Jul  7 07:28:56 2009
New Revision: 791731

URL: http://svn.apache.org/viewvc?rev=791731&view=rev
Log:
MAPREDUCE-708. Fixes a bug to allow updating the reason for blacklisting a node on the JobTracker
UI. Contributed by Sreekanth Ramakrishnan.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=791731&r1=791730&r2=791731&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Tue Jul  7 07:28:56 2009
@@ -129,3 +129,7 @@
     The initialization of JobHistoryFilesManager is now done in the 
     JobHistory.init call. (Amar Kamat via ddas)
 
+    MAPREDUCE-708. Fixes a bug to allow updating the reason for
+    blacklisting a node on the JobTracker UI.
+    (Sreekanth Ramakrishnan via yhemanth)
+

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=791731&r1=791730&r2=791731&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Tue Jul  7 07:28:56
2009
@@ -609,14 +609,9 @@
       FaultInfo fi = getFaultInfo(hostName, true);
       boolean blackListed = fi.isBlacklisted();
       if(blackListed) {
-        if(fi.getReasonforblacklisting().contains(rfb)) {
-          return;
-        } else {
-          LOG.info("Adding blacklisted reason for tracker : " + hostName 
-              + " Reason for blacklisting is : " + rfb);
-          fi.addBlackListedReason(rfb, reason);
-        }
-        return;
+        LOG.info("Adding blacklisted reason for tracker : " + hostName 
+            + " Reason for blacklisting is : " + rfb);
+        fi.addBlackListedReason(rfb, reason);
       } else {
         LOG.info("Blacklisting tracker : " + hostName 
             + " Reason for blacklisting is : " + rfb);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java?rev=791731&r1=791730&r2=791731&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerBlacklisting.java
Tue Jul  7 07:28:56 2009
@@ -239,6 +239,44 @@
     
     clock.jumpADay = false;
   }
+  
+  public void testBlacklistingReasonString() throws Exception {
+    String error = "ERROR";
+    String error1 = "ERROR1";
+    TaskTrackerHealthStatus status = new TaskTrackerHealthStatus();
+    status.setNodeHealthy(false);
+    status.setLastReported(System.currentTimeMillis());
+    status.setHealthReport(error);
+    sendHeartBeat(status, false);
+
+    assertEquals("All trackers not blacklisted", jobTracker
+        .getBlacklistedTrackerCount(), 3);
+
+    checkReasonForBlackListing(hosts[0], nodeUnHealthyReasonSet);
+    checkReasonForBlackListing(hosts[1], nodeUnHealthyReasonSet);
+    checkReasonForBlackListing(hosts[2], nodeUnHealthyReasonSet);
+    for (int i = 0; i < hosts.length; i++) {
+      //Replace new line as we are adding new line
+      //in getReasonsForBlacklisting
+      assertEquals("Blacklisting reason string not correct for host " + i,
+          jobTracker.getReasonsForBlacklisting(hosts[i]).replace("\n", ""),
+          error);
+    }
+    status.setNodeHealthy(false);
+    status.setLastReported(System.currentTimeMillis());
+    status.setHealthReport(error1);
+    sendHeartBeat(status, false);
+    checkReasonForBlackListing(hosts[0], nodeUnHealthyReasonSet);
+    checkReasonForBlackListing(hosts[1], nodeUnHealthyReasonSet);
+    checkReasonForBlackListing(hosts[2], nodeUnHealthyReasonSet);
+    for (int i = 0; i < hosts.length; i++) {
+      //Replace new line as we are adding new line
+      //in getReasonsForBlacklisting
+      assertEquals("Blacklisting reason string not correct for host " + i,
+          jobTracker.getReasonsForBlacklisting(hosts[i]).replace("\n", ""),
+          error1);
+    }
+  }
 
   private void runBlackListingJob() throws IOException, Exception {
     TaskAttemptID[] taskAttemptID = new TaskAttemptID[3];



Mime
View raw message