hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r1132788 - in /hadoop/common/branches/branch-0.20-security-205/src: contrib/streaming/src/test/system/org/apache/hadoop/mapred/ test/system/java/org/apache/hadoop/mapred/ test/system/java/org/apache/hadoop/test/system/process/
Date Mon, 06 Jun 2011 21:33:31 GMT
Author: cdouglas
Date: Mon Jun  6 21:33:31 2011
New Revision: 1132788

URL: http://svn.apache.org/viewvc?rev=1132788&view=rev
Log:
MAPREDUCE-2535. Fix system tests affected by previous commit.
(Robert Joseph Evans via cdouglas)

Modified:
    hadoop/common/branches/branch-0.20-security-205/src/contrib/streaming/src/test/system/org/apache/hadoop/mapred/TestTaskKillingOfStreamingJob.java
    hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestJobCacheDirectoriesCleanUp.java
    hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskChildsKilling.java
    hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskKilling.java
    hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskTrackerInfoSuccessfulFailedJobs.java
    hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java

Modified: hadoop/common/branches/branch-0.20-security-205/src/contrib/streaming/src/test/system/org/apache/hadoop/mapred/TestTaskKillingOfStreamingJob.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/contrib/streaming/src/test/system/org/apache/hadoop/mapred/TestTaskKillingOfStreamingJob.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/contrib/streaming/src/test/system/org/apache/hadoop/mapred/TestTaskKillingOfStreamingJob.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/contrib/streaming/src/test/system/org/apache/hadoop/mapred/TestTaskKillingOfStreamingJob.java
Mon Jun  6 21:33:31 2011
@@ -27,7 +27,6 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.hadoop.mapred.JobClient.NetworkedJob;
 import org.apache.hadoop.mapreduce.test.system.JTProtocol;
 import org.apache.hadoop.mapreduce.test.system.JobInfo;
 import org.apache.hadoop.mapreduce.test.system.MRCluster;
@@ -94,7 +93,7 @@ public class TestTaskKillingOfStreamingJ
         jtClient.isTaskStarted(taskInfo));
 
     JobInfo jInfo = wovenClient.getJobInfo(jobId); 
-    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
+    RunningJob networkJob = client.getJob(jobId);
     TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
     TaskAttemptID taskAttID = new TaskAttemptID(tID, 0);
     networkJob.killTask(taskAttID, false);
@@ -153,7 +152,7 @@ public class TestTaskKillingOfStreamingJ
         jtClient.isTaskStarted(taskInfo));
     
     JobInfo jInfo = wovenClient.getJobInfo(jobId);
-    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
+    RunningJob networkJob = client.getJob(jobId);
     TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
     TaskAttemptID taskAttID = new TaskAttemptID(tID, 0);
     networkJob.killTask(taskAttID, true);

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestJobCacheDirectoriesCleanUp.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestJobCacheDirectoriesCleanUp.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestJobCacheDirectoriesCleanUp.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestJobCacheDirectoriesCleanUp.java
Mon Jun  6 21:33:31 2011
@@ -28,7 +28,6 @@ import org.apache.hadoop.mapreduce.test.
 import org.apache.hadoop.mapreduce.test.system.JTProtocol;
 import org.apache.hadoop.mapreduce.test.system.TaskInfo;
 import org.apache.hadoop.mapreduce.test.system.JobInfo;
-import org.apache.hadoop.mapred.JobClient.NetworkedJob;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.permission.FsAction;
@@ -189,8 +188,8 @@ public class TestJobCacheDirectoriesClea
           int MAX_MAP_TASK_ATTEMPTS = Integer.
                parseInt(jobConf.get("mapred.map.max.attempts"));
           while(taskinfo.numFailedAttempts() < MAX_MAP_TASK_ATTEMPTS) {
-            NetworkedJob networkJob = jtClient.getClient().
-               new NetworkedJob(jobInfo.getStatus());
+            org.apache.hadoop.mapreduce.JobID temp = jobInfo.getID();
+            RunningJob networkJob = client.getJob(new JobID(temp.getJtIdentifier(), temp.getId()));
             networkJob.killTask(taskAttID, true);
             taskinfo = rtClient.getTaskInfo(taskinfo.getTaskID());
             taskAttID = new TaskAttemptID(taskId, taskinfo.numFailedAttempts());

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskChildsKilling.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskChildsKilling.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskChildsKilling.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskChildsKilling.java
Mon Jun  6 21:33:31 2011
@@ -35,7 +35,6 @@ import org.apache.hadoop.mapreduce.test.
 import org.apache.hadoop.mapreduce.test.system.TTTaskInfo;
 import org.apache.hadoop.mapreduce.test.system.TaskInfo;
 import org.apache.hadoop.mapreduce.test.system.FinishTaskControlAction;
-import org.apache.hadoop.mapred.JobClient.NetworkedJob;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.hadoop.util.Tool;
 import org.junit.AfterClass;
@@ -271,8 +270,7 @@ public class TestTaskChildsKilling {
     Assert.assertTrue("Map process is not alive before task kills.", 
         ttIns.isProcessTreeAlive(pid));
 
-    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
-    networkJob.killTask(taskAttID, false);
+    runJob.killTask(taskAttID, false);
 
     LOG.info("Waiting till the task is killed...");
     taskInfo = wovenClient.getTaskInfo(taskInfo.getTaskID());

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskKilling.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskKilling.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskKilling.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskKilling.java
Mon Jun  6 21:33:31 2011
@@ -34,7 +34,6 @@ import org.apache.hadoop.mapreduce.test.
 import org.apache.hadoop.mapreduce.test.system.TTClient;
 import org.apache.hadoop.mapreduce.test.system.JTClient;
 import org.apache.hadoop.mapreduce.test.system.FinishTaskControlAction;
-import org.apache.hadoop.mapred.JobClient.NetworkedJob;
 import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
@@ -100,7 +99,7 @@ public class TestTaskKilling {
         jtClient.isTaskStarted(taskInfo));
 
     // Fail the running task.
-    NetworkedJob networkJob = jobClient.new NetworkedJob(jInfo.getStatus());
+    RunningJob networkJob = jobClient.getJob(jobId);
     TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
     TaskAttemptID taskAttID = new TaskAttemptID(tID , 0);
     networkJob.killTask(taskAttID, true);
@@ -206,7 +205,7 @@ public class TestTaskKilling {
             taskAttID + " has not been found while task was running.", 
                     isTempFolderExists);
     
-    NetworkedJob networkJob = jobClient.new NetworkedJob(jInfo.getStatus());
+    RunningJob networkJob = jobClient.getJob(id);
     networkJob.killTask(taskAttID, false);
     ttClient.getProxy().sendAction(action);
     taskInfo = remoteJTClient.getTaskInfo(tID);
@@ -353,8 +352,7 @@ public class TestTaskKilling {
         TaskAttemptID tAttID = new TaskAttemptID(taskId, 
             taskInfo.numFailedAttempts());
         while(taskInfo.numFailedAttempts() < MAX_MAP_TASK_ATTEMPTS) {
-          NetworkedJob networkJob = jtClient.getClient().
-             new NetworkedJob(jobInfo.getStatus());
+          RunningJob networkJob = jobClient.getJob(id);
           networkJob.killTask(taskAttID, true);
           taskInfo = remoteJTClient.getTaskInfo(taskInfo.getTaskID());
           taskAttID = new TaskAttemptID(taskId, taskInfo.numFailedAttempts());
@@ -484,8 +482,7 @@ public class TestTaskKilling {
             taskIdKilled = taskid.toString();
             taskAttemptID = new TaskAttemptID(taskid, i);
             LOG.info("taskAttemptid going to be killed is : " + taskAttemptID);
-            (jobClient.new NetworkedJob(jInfo.getStatus())).
-                killTask(taskAttemptID,true);
+            rJob.killTask(taskAttemptID,true);
             checkTaskCompletionEvent(taskAttemptID, jInfo);
             break;
           } else {
@@ -495,8 +492,7 @@ public class TestTaskKilling {
               UtilsForTests.waitFor(20000);
               LOG.info("taskAttemptid going to be killed is : " +
                   taskAttemptID);
-              (jobClient.new NetworkedJob(jInfo.getStatus())).
-                  killTask(taskAttemptID,true);
+              rJob.killTask(taskAttemptID,true);
               checkTaskCompletionEvent(taskAttemptID,jInfo);
               break;
             }
@@ -536,8 +532,10 @@ public class TestTaskKilling {
     boolean match = false;
     int count = 0;
     while (!match) {
-      TaskCompletionEvent[] taskCompletionEvents =  jobClient.new
-        NetworkedJob(jInfo.getStatus()).getTaskCompletionEvents(0);
+      org.apache.hadoop.mapreduce.JobID temp = jInfo.getID();
+      RunningJob rJob = jobClient.getJob(new JobID(temp.getJtIdentifier(), temp.getId()));
+ 
+      TaskCompletionEvent[] taskCompletionEvents =  rJob.getTaskCompletionEvents(0);
       for (TaskCompletionEvent taskCompletionEvent : taskCompletionEvents) {
         LOG.info("taskCompletionEvent.getTaskAttemptId().toString() is : " + 
           taskCompletionEvent.getTaskAttemptId().toString());

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskTrackerInfoSuccessfulFailedJobs.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskTrackerInfoSuccessfulFailedJobs.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskTrackerInfoSuccessfulFailedJobs.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/mapred/TestTaskTrackerInfoSuccessfulFailedJobs.java
Mon Jun  6 21:33:31 2011
@@ -30,7 +30,6 @@ import org.apache.hadoop.mapreduce.test.
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapred.UtilsForTests;
-import org.apache.hadoop.mapred.JobClient.NetworkedJob;
 import org.apache.hadoop.examples.SleepJob;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.fs.permission.FsAction;
@@ -340,11 +339,9 @@ public class TestTaskTrackerInfoSuccessf
     Assert.assertTrue("Task has not been started for 1 min.", 
       count != 60);
 
-    NetworkedJob networkJob = (cluster.getJTClient().getClient()).new 
-      NetworkedJob(jInfo.getStatus());
     TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
     TaskAttemptID taskAttID = new TaskAttemptID(tID , 0);
-    networkJob.killTask(taskAttID, false);
+    rJob.killTask(taskAttID, false);
 
     count = 0;
     LOG.info("Waiting till the job is completed...");

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java?rev=1132788&r1=1132787&r2=1132788&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/system/java/org/apache/hadoop/test/system/process/HadoopDaemonRemoteCluster.java
Mon Jun  6 21:33:31 2011
@@ -124,9 +124,11 @@ public abstract class HadoopDaemonRemote
         }
       } finally {
         try {
-          reader.close();
+          if(reader != null) {
+              reader.close();
+          }
         } catch (IOException e) {
-          LOG.warn("Could not close reader");
+          LOG.warn("Could not close reader", e);
         }
       }
       LOG.info("Created HadoopDaemonInfo for " + cmd + " " + role + " from " 



Mime
View raw message