Author: ddas
Date: Wed Jun 17 12:29:32 2009
New Revision: 785572
URL: http://svn.apache.org/viewvc?rev=785572&view=rev
Log:
Merge -r 785568:785569 from trunk onto 0.20 branch. Fixes HADOOP-5920.
Modified:
hadoop/core/branches/branch-0.20/ (props changed)
hadoop/core/branches/branch-0.20/CHANGES.txt (contents, props changed)
hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobHistory.java
hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestJobHistory.java
Propchange: hadoop/core/branches/branch-0.20/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 17 12:29:32 2009
@@ -1,2 +1,2 @@
/hadoop/core/branches/branch-0.19:713112
-/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732613,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745,743816,743892,744894,745180,746010,746206,746227,746233,746274,746338,746902-746903,746925,746944,746968,746970,747279,747289,747802,748084,748090,748783,749262,749318,749863,750533,752073,752609,752834,752836,752913,752932,753112-753113,753346,754645,754847,754927,755035,755226,755348,755370,755418,755426,755790,755905,755938,755960,755986,755998,756352,757448,757624,757849,758156,758180,759398,759932,760502,760783,761046,761482,761632,762216,762879,763107,763502,764967,765016,765809,765951,771607,771661,772844,772876,772884,772920,773889,776638,778962,778966,779893,781720,784661,785046
+/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732613,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745,743816,743892,744894,745180,746010,746206,746227,746233,746274,746338,746902-746903,746925,746944,746968,746970,747279,747289,747802,748084,748090,748783,749262,749318,749863,750533,752073,752609,752834,752836,752913,752932,753112-753113,753346,754645,754847,754927,755035,755226,755348,755370,755418,755426,755790,755905,755938,755960,755986,755998,756352,757448,757624,757849,758156,758180,759398,759932,760502,760783,761046,761482,761632,762216,762879,763107,763502,764967,765016,765809,765951,771607,771661,772844,772876,772884,772920,773889,776638,778962,778966,779893,781720,784661,785046,785569
Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=785572&r1=785571&r2=785572&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Wed Jun 17 12:29:32 2009
@@ -135,6 +135,9 @@
(usually HDFS) is started at nearly the same time as the JobTracker.
(Amar Kamat via ddas)
+ HADOOP-5920. Fixes a testcase failure for TestJobHistory.
+ (Amar Kamat via ddas)
+
Release 0.20.0 - 2009-04-15
INCOMPATIBLE CHANGES
Propchange: hadoop/core/branches/branch-0.20/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 17 12:29:32 2009
@@ -1,3 +1,3 @@
/hadoop/core/branches/branch-0.18/CHANGES.txt:727226
/hadoop/core/branches/branch-0.19/CHANGES.txt:713112
-/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732613,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745,743816,743892,744894,745180,745268,746010,746193,746206,746227,746233,746274,746902-746903,746925,746944,746968,746970,747279,747289,747802,748084,748090,748783,749262,749318,749863,750533,752073,752514,752555,752590,752609,752834,752836,752913,752932,753112-753113,753346,754645,754847,754927,755035,755226,755348,755370,755418,755426,755790,755905,755938,755986,755998,756352,757448,757624,757849,758156,758180,759398,759932,760502,760783,761046,761482,761632,762216,762879,763107,763502,764967,765016,765809,765951,771607,772844,772876,772884,772920,773889,776638,778962,778966,779893,781720,784661,785046
+/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732613,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745,743816,743892,744894,745180,745268,746010,746193,746206,746227,746233,746274,746902-746903,746925,746944,746968,746970,747279,747289,747802,748084,748090,748783,749262,749318,749863,750533,752073,752514,752555,752590,752609,752834,752836,752913,752932,753112-753113,753346,754645,754847,754927,755035,755226,755348,755370,755418,755426,755790,755905,755938,755986,755998,756352,757448,757624,757849,758156,758180,759398,759932,760502,760783,761046,761482,761632,762216,762879,763107,763502,764967,765016,765809,765951,771607,772844,772876,772884,772920,773889,776638,778962,778966,779893,781720,784661,785046,785569
Modified:
hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=785572&r1=785571&r2=785572&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobHistory.java
(original)
+++
hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobHistory.java
Wed Jun 17 12:29:32 2009
@@ -381,6 +381,13 @@
}
/**
+ * Get the history location
+ */
+ static Path getJobHistoryLocation() {
+ return new Path(LOG_DIR);
+ }
+
+ /**
* Base class contais utility stuff to manage types key value pairs with
enums.
*/
static class KeyValuePair{
Modified:
hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestJobHistory.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestJobHistory.java?rev=785572&r1=785571&r2=785572&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestJobHistory.java
(original)
+++
hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestJobHistory.java
Wed Jun 17 12:29:32 2009
@@ -31,6 +31,7 @@
import junit.framework.TestCase;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
@@ -803,6 +804,7 @@
} finally {
if (mr != null) {
+ cleanupLocalFiles(mr);
mr.shutdown();
}
}
@@ -845,7 +847,7 @@
assertTrue("User log file " + logFile + " does not exist",
fileSys.exists(logFile));
}
- else if (conf.get("hadoop.job.history.user.location") == "none") {
+ else if ("none".equals(conf.get("hadoop.job.history.user.location"))) {
// history file should not exist in the output path
assertFalse("Unexpected. User log file exists in output dir when " +
"hadoop.job.history.user.location is set to \"none\"",
@@ -910,11 +912,24 @@
} finally {
if (mr != null) {
+ cleanupLocalFiles(mr);
mr.shutdown();
}
}
}
+ private void cleanupLocalFiles(MiniMRCluster mr)
+ throws IOException {
+ Configuration conf = mr.createJobConf();
+ JobTracker jt = mr.getJobTrackerRunner().getJobTracker();
+ Path sysDir = new Path(jt.getSystemDir());
+ FileSystem fs = sysDir.getFileSystem(conf);
+ fs.delete(sysDir, true);
+ Path jobHistoryDir = JobHistory.getJobHistoryLocation();
+ fs = jobHistoryDir.getFileSystem(conf);
+ fs.delete(jobHistoryDir, true);
+ }
+
/**
* Checks if the history file has expected job status
* @param id job id
@@ -991,6 +1006,7 @@
} finally {
if (mr != null) {
+ cleanupLocalFiles(mr);
mr.shutdown();
}
}