You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by dd...@apache.org on 2009/09/07 08:07:18 UTC
svn commit: r812002 - in /hadoop/mapreduce/trunk: CHANGES.txt
src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java
Author: ddas
Date: Mon Sep 7 06:07:18 2009
New Revision: 812002
URL: http://svn.apache.org/viewvc?rev=812002&view=rev
Log:
MAPREDUCE-943. Removes a testcase in TestNodeRefresh that doesn't make sense in the new Job recovery model. Contributed by Amar Kamat.
Modified:
hadoop/mapreduce/trunk/CHANGES.txt
hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java
Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=812002&r1=812001&r2=812002&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Mon Sep 7 06:07:18 2009
@@ -521,3 +521,6 @@
MAPREDUCE-903. Add Avro jar to eclipse classpath.
(Philip Zeyliger via tomwhite)
+
+ MAPREDUCE-943. Removes a testcase in TestNodeRefresh that doesn't make
+ sense in the new Job recovery model. (Amar Kamat via ddas)
Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java?rev=812002&r1=812001&r2=812002&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeRefresh.java Mon Sep 7 06:07:18 2009
@@ -376,87 +376,4 @@
stopCluster();
}
-
- /**
- * Check if excluded hosts are decommissioned across restart
- */
- public void testMRExcludeHostsAcrossRestarts() throws IOException {
- // start a cluster with 2 hosts and empty exclude-hosts file
- Configuration conf = new Configuration();
- conf.setBoolean("mapred.jobtracker.restart.recover", true);
-
- File file = new File("hosts.exclude");
- file.delete();
- startCluster(1, 1, 0, conf);
- String hostToDecommission = getHostname(1);
- conf = mr.createJobConf(new JobConf(conf));
-
- // submit a job
- Path inDir = new Path("input");
- Path outDir = new Path("output");
- Path signalFilename = new Path("share");
- JobConf newConf = new JobConf(conf);
- UtilsForTests.configureWaitingJobConf(newConf, inDir, outDir, 30, 1,
- "restart-decommission", signalFilename.toString(),
- signalFilename.toString());
-
- JobClient jobClient = new JobClient(newConf);
- RunningJob job = jobClient.submitJob(newConf);
- JobID id = job.getID();
-
- // wait for 50%
- while (job.mapProgress() < 0.5f) {
- UtilsForTests.waitFor(100);
- }
-
- // change the exclude-hosts file to include one host
- FileOutputStream out = new FileOutputStream(file);
- LOG.info("Writing excluded nodes to log file " + file.toString());
- BufferedWriter writer = null;
- try {
- writer = new BufferedWriter(new OutputStreamWriter(out));
- writer.write( hostToDecommission + "\n"); // decommission first host
- } finally {
- if (writer != null) {
- writer.close();
- }
- out.close();
- }
- file.deleteOnExit();
-
- // restart the jobtracker
- mr.stopJobTracker();
- mr.startJobTracker();
-
- // Wait for the JT to be ready
- UtilsForTests.waitForJobTracker(jobClient);
-
- jt = mr.getJobTrackerRunner().getJobTracker();
- UtilsForTests.signalTasks(dfs, dfs.getFileSystem(),
- signalFilename.toString(), signalFilename.toString(), 1);
-
- assertTrue("Decommissioning of tracker has effect on restarted job",
- jt.getJob(job.getID()).failedMapTasks == 0);
-
- // check the cluster status and tracker size
- assertEquals("Tracker is not lost upon host decommissioning",
- 0, jt.getClusterStatus(false).getTaskTrackers());
- assertEquals("Excluded node count is incorrect",
- 1, jt.getClusterStatus(false).getNumExcludedNodes());
-
- // check if the host is disallowed
- for (TaskTrackerStatus status : jt.taskTrackers()) {
- assertFalse("Tracker from decommissioned host still exist",
- status.getHost().equals(hostToDecommission));
- }
-
- // start a tracker so that the jobs move to completion
- String newTrackerHostName = getHostname(2);
- mr.startTaskTracker(newTrackerHostName, null, 2, 1);
-
- // wait for the job
- job.waitForCompletion();
-
- stopCluster();
- }
}