hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r951793 - in /hadoop/mapreduce/trunk: ./ src/java/org/apache/hadoop/mapreduce/ src/test/mapred/org/apache/hadoop/mapred/ src/test/mapred/org/apache/hadoop/mapreduce/ src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/ src/test/mapred...
Date Sun, 06 Jun 2010 01:28:11 GMT
Author: cdouglas
Date: Sun Jun  6 01:28:10 2010
New Revision: 951793

URL: http://svn.apache.org/viewvc?rev=951793&view=rev
Log:
MAPREDUCE-1505. Create RPC client on job submission, not in cstr of Job
instance. Contributed by Dick King

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRLocalFS.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/FailJob.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/MapReduceTestUtil.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestChild.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestLocalRunner.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLazyOutput.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLocal.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestValueIterReset.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/TestMapReduceAggregates.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDBOutputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestCombineFileInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestDelegatingInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestFileInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsBinaryInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsTextInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMultipleInputs.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestNLineInputFormat.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinDatamerge.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinProperties.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestWrappedRRClassloader.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Sun Jun  6 01:28:10 2010
@@ -69,6 +69,9 @@ Trunk (unreleased changes)
     MAPREDUCE-1836. Refresh for proxy superuser config (mr part for HDFS-1096).
     (Boris Shkolnik via shv)
 
+    MAPREDUCE-1505. Create RPC client on job submission, not in cstr of Job
+    instance. (Dick King via cdouglas)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Job.java Sun Jun  6 01:28:10
2010
@@ -152,6 +152,49 @@ public class Job extends JobContextImpl 
     this.status = status;
     state = JobState.RUNNING;
   }
+
+      
+  /**
+   * Creates a new {@link Job} with no particular {@link Cluster} .
+   * A Cluster will be created with a generic {@link Configuration}.
+   * 
+   * @return the {@link Job} , with no connection to a cluster yet.
+   * @throws IOException
+   */
+  public static Job getInstance() throws IOException {
+    // create with a null Cluster
+    return getInstance(new Configuration());
+  }
+      
+  /**
+   * Creates a new {@link Job} with no particular {@link Cluster} .
+   * A Cluster will be created from the conf parameter only when it's needed.
+   * 
+   * @param conf the configuration
+   * @return the {@link Job} , with no connection to a cluster yet.
+   * @throws IOException
+   */
+  public static Job getInstance(Configuration conf) throws IOException {
+    // create with a null Cluster
+    return new Job(null, conf);
+  }
+
+      
+  /**
+   * Creates a new {@link Job} with no particular {@link Cluster} and a given jobName.
+   * A Cluster will be created from the conf parameter only when it's needed.
+   * 
+   * @param conf the configuration
+   * @return the {@link Job} , with no connection to a cluster yet.
+   * @throws IOException
+   */
+  public static Job getInstance(Configuration conf, String jobName)
+           throws IOException {
+    // create with a null Cluster
+    Job result = new Job(null, conf);
+    result.setJobName(jobName);
+    return result;
+  }
   
   public static Job getInstance(Cluster cluster) throws IOException {
      return new Job(cluster);
@@ -172,6 +215,12 @@ public class Job extends JobContextImpl 
       throw new IllegalStateException("Job in state "+ this.state + 
                                       " instead of " + state);
     }
+
+    if (state == JobState.RUNNING && cluster == null) {
+      throw new IllegalStateException
+        ("Job in state " + this.state
+         + ", but it isn't attached to any job tracker!");
+    }
   }
 
   /**
@@ -949,14 +998,33 @@ public class Job extends JobContextImpl 
     }   
   }
 
+  private synchronized void connect()
+          throws IOException, InterruptedException, ClassNotFoundException {
+    if (cluster == null) {
+      cluster = 
+        ugi.doAs(new PrivilegedExceptionAction<Cluster>() {
+                   public Cluster run()
+                          throws IOException, InterruptedException, 
+                                 ClassNotFoundException {
+                     return new Cluster(getConfiguration());
+                   }
+                 });
+    }
+  }
+
+  boolean isConnected() {
+    return cluster != null;
+  }
+
   /**
    * Submit the job to the cluster and return immediately.
    * @throws IOException
    */
-  public void submit() throws IOException, InterruptedException, 
-                              ClassNotFoundException {
+  public void submit() 
+         throws IOException, InterruptedException, ClassNotFoundException {
     ensureState(JobState.DEFINE);
     setUseNewAPI();
+    connect();
     final JobSubmitter submitter = new JobSubmitter(cluster.getFileSystem(),
         cluster.getClient());
     status = ugi.doAs(new PrivilegedExceptionAction<JobStatus>() {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMRWithDistributedCache.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
Sun Jun  6 01:28:10 2010
@@ -134,7 +134,7 @@ public class TestMRWithDistributedCache 
         makeJar(new Path(TEST_ROOT_DIR, "distributed.fourth.jar"), 4);
 
 
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     job.setMapperClass(DistributedCacheChecker.class);
     job.setOutputFormatClass(NullOutputFormat.class);
     FileInputFormat.setInputPaths(job, first);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRLocalFS.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRLocalFS.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRLocalFS.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRLocalFS.java
Sun Jun  6 01:28:10 2010
@@ -311,7 +311,7 @@ public class TestMiniMRLocalFS extends T
     TestMapReduceLocal.writeFile
              ("in/part1", "-1 -4\n-3 23\n5 10\n-1 -2\n-1 300\n-1 10\n4 1\n" +
               "4 2\n4 10\n4 -1\n4 -10\n10 20\n10 30\n10 25\n");
-    Job job = new Job(conf, "word count");
+    Job job = Job.getInstance(conf, "word count");
     job.setJarByClass(WordCount.class);
     job.setNumReduceTasks(2);
     job.setMapperClass(SecondarySort.MapClass.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
Sun Jun  6 01:28:10 2010
@@ -138,7 +138,7 @@ public class TestTaskTrackerLocalization
     jobConf.setInt(MRJobConfig.USER_LOG_RETAIN_HOURS, 0);
     jobConf.setUser(getJobOwner().getShortUserName());
 
-    Job job = new Job(jobConf);
+    Job job = Job.getInstance(jobConf);
     String jtIdentifier = "200907202331";
     jobId = new JobID(jtIdentifier, 1);
 

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/FailJob.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/FailJob.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/FailJob.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/FailJob.java Sun Jun
 6 01:28:10 2010
@@ -80,7 +80,7 @@ public class FailJob extends Configured 
     Configuration conf = getConf();
     conf.setBoolean(FAIL_MAP, failMappers);
     conf.setBoolean(FAIL_REDUCE, failReducers);
-    Job job = new Job(conf, "fail");
+    Job job = Job.getInstance(conf, "fail");
     job.setJarByClass(FailJob.class);
     job.setMapperClass(FailMapper.class);
     job.setMapOutputKeyClass(LongWritable.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/GenericMRLoadGenerator.java
Sun Jun  6 01:28:10 2010
@@ -129,7 +129,7 @@ public class GenericMRLoadGenerator exte
   }
 
   public int run(String [] argv) throws Exception {
-    Job job = new Job(getConf());
+    Job job = Job.getInstance(getConf());
     job.setJarByClass(GenericMRLoadGenerator.class);
     job.setMapperClass(SampleMapper.class);
     job.setReducerClass(SampleReducer.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/MapReduceTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/MapReduceTestUtil.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/MapReduceTestUtil.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/MapReduceTestUtil.java
Sun Jun  6 01:28:10 2010
@@ -138,7 +138,7 @@ public class MapReduceTestUtil {
   public static Job createCopyJob(Configuration conf, Path outdir, 
       Path... indirs) throws Exception {
     conf.setInt(MRJobConfig.NUM_MAPS, 3);
-    Job theJob = new Job(conf);
+    Job theJob = Job.getInstance(conf);
     theJob.setJobName("DataMoveJob");
 
     FileInputFormat.setInputPaths(theJob, indirs);
@@ -167,7 +167,7 @@ public class MapReduceTestUtil {
       fs.delete(outdir, true);
     }
     conf.setInt(MRJobConfig.MAP_MAX_ATTEMPTS, 2);
-    Job theJob = new Job(conf);
+    Job theJob = Job.getInstance(conf);
     theJob.setJobName("Fail-Job");
 
     FileInputFormat.setInputPaths(theJob, indirs);
@@ -192,7 +192,7 @@ public class MapReduceTestUtil {
   public static Job createKillJob(Configuration conf, Path outdir, 
       Path... indirs) throws Exception {
 
-    Job theJob = new Job(conf);
+    Job theJob = Job.getInstance(conf);
     theJob.setJobName("Kill-Job");
 
     FileInputFormat.setInputPaths(theJob, indirs);
@@ -354,7 +354,7 @@ public class MapReduceTestUtil {
 
   public static Job createJob(Configuration conf, Path inDir, Path outDir, 
       int numInputFiles, int numReds, String input) throws IOException {
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     FileSystem fs = FileSystem.get(conf);
     if (fs.exists(outDir)) {
       fs.delete(outDir, true);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java Sun Jun
 6 01:28:10 2010
@@ -202,7 +202,7 @@ public class SleepJob extends Configured
     conf.setInt(MAP_SLEEP_COUNT, mapSleepCount);
     conf.setInt(REDUCE_SLEEP_COUNT, reduceSleepCount);
     conf.setInt(MRJobConfig.NUM_MAPS, numMapper);
-    Job job = new Job(conf, "sleep");
+    Job job = Job.getInstance(conf, "sleep");
     job.setNumReduceTasks(numReducer);
     job.setJarByClass(SleepJob.class);
     job.setNumReduceTasks(numReducer);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestChild.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestChild.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestChild.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestChild.java Sun
Jun  6 01:28:10 2010
@@ -128,6 +128,11 @@ public class TestChild extends HadoopTes
                 numMaps, numReds);
     job.setMapperClass(MyMapper.class);
     job.setReducerClass(MyReducer.class);
+    assertFalse("Job already has a job tracker connection, before it's submitted",
+                job.isConnected());
+    job.submit();
+    assertTrue("Job doesn't have a job tracker connection, even though it's been submitted",
+               job.isConnected());
     job.waitForCompletion(true);
     assertTrue(job.isSuccessful());
 

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestLocalRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestLocalRunner.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestLocalRunner.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestLocalRunner.java
Sun Jun  6 01:28:10 2010
@@ -294,7 +294,7 @@ public class TestLocalRunner extends Tes
     createInputFile(inputPath, 0, 20);
 
     // Now configure and run the job.
-    Job job = new Job();
+    Job job = Job.getInstance();
     job.setMapperClass(GCMapper.class);
     job.setNumReduceTasks(0);
     job.getConfiguration().set("io.sort.mb", "25");
@@ -320,7 +320,7 @@ public class TestLocalRunner extends Tes
    */
   @Test
   public void testMultiMaps() throws Exception {
-    Job job = new Job();
+    Job job = Job.getInstance();
 
     Path inputPath = createMultiMapsInput();
     Path outputPath = getOutputPath();
@@ -352,7 +352,7 @@ public class TestLocalRunner extends Tes
    */
   @Test
   public void testInvalidMultiMapParallelism() throws Exception {
-    Job job = new Job();
+    Job job = Job.getInstance();
 
     Path inputPath = createMultiMapsInput();
     Path outputPath = getOutputPath();
@@ -413,7 +413,7 @@ public class TestLocalRunner extends Tes
 
   /** Test case for zero mappers */
   public void testEmptyMaps() throws Exception {
-    Job job = new Job();
+    Job job = Job.getInstance();
     Path outputPath = getOutputPath();
 
     Configuration conf = new Configuration();

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduce.java
Sun Jun  6 01:28:10 2010
@@ -286,7 +286,7 @@ public class TestMapReduce extends TestC
     fs.delete(randomOuts, true);
 
 
-    Job genJob = new Job(conf);
+    Job genJob = Job.getInstance(conf);
     FileInputFormat.setInputPaths(genJob, randomIns);
     genJob.setInputFormatClass(SequenceFileInputFormat.class);
     genJob.setMapperClass(RandomGenMapper.class);
@@ -331,7 +331,7 @@ public class TestMapReduce extends TestC
     int intermediateReduces = 10;
     Path intermediateOuts = new Path(testdir, "intermediateouts");
     fs.delete(intermediateOuts, true);
-    Job checkJob = new Job(conf);
+    Job checkJob = Job.getInstance(conf);
     FileInputFormat.setInputPaths(checkJob, randomOuts);
     checkJob.setMapperClass(RandomCheckMapper.class);
 
@@ -353,7 +353,7 @@ public class TestMapReduce extends TestC
     //
     Path finalOuts = new Path(testdir, "finalouts");
     fs.delete(finalOuts, true);
-    Job mergeJob = new Job(conf);
+    Job mergeJob = Job.getInstance(conf);
     FileInputFormat.setInputPaths(mergeJob, intermediateOuts);
     mergeJob.setInputFormatClass(SequenceFileInputFormat.class);
     mergeJob.setMapperClass(MergeMapper.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLazyOutput.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLazyOutput.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLazyOutput.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLazyOutput.java
Sun Jun  6 01:28:10 2010
@@ -88,7 +88,7 @@ public class TestMapReduceLazyOutput ext
   private static void runTestLazyOutput(Configuration conf, Path output,
       int numReducers, boolean createLazily) 
   throws Exception {
-    Job job = new Job(conf, "Test-Lazy-Output");
+    Job job = Job.getInstance(conf, "Test-Lazy-Output");
 
     FileInputFormat.setInputPaths(job, INPUT);
     FileOutputFormat.setOutputPath(job, output);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLocal.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLocal.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLocal.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestMapReduceLocal.java
Sun Jun  6 01:28:10 2010
@@ -130,7 +130,7 @@ public class TestMapReduceLocal extends 
     localFs.delete(new Path(TEST_ROOT_DIR + "/out"), true);    
     writeFile("in/part1", "this is a test\nof word count test\ntest\n");
     writeFile("in/part2", "more test");
-    Job job = new Job(conf, "word count");     
+    Job job = Job.getInstance(conf, "word count");     
     job.setJarByClass(WordCount.class);
     job.setMapperClass(TokenizerMapper.class);
     job.setCombinerClass(IntSumReducer.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestValueIterReset.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestValueIterReset.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestValueIterReset.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestValueIterReset.java
Sun Jun  6 01:28:10 2010
@@ -521,7 +521,7 @@ public class TestValueIterReset extends 
   public void testValueIterReset() {
     try {
       Configuration conf = new Configuration();
-      Job job = new Job(conf, "TestValueIterReset") ;
+      Job job = Job.getInstance(conf, "TestValueIterReset") ;
       job.setJarByClass(TestValueIterReset.class);
       job.setMapperClass(TestMapper.class);
       job.setReducerClass(TestReducer.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/TestMapReduceAggregates.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/TestMapReduceAggregates.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/TestMapReduceAggregates.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/aggregate/TestMapReduceAggregates.java
Sun Jun  6 01:28:10 2010
@@ -89,7 +89,7 @@ public class TestMapReduceAggregates ext
       "UserDefined,org.apache.hadoop.mapreduce.lib.aggregate.AggregatorTests");
     conf.setLong(UniqValueCount.MAX_NUM_UNIQUE_VALUES, 14);
     
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     FileInputFormat.setInputPaths(job, INPUT_DIR);
     job.setInputFormatClass(TextInputFormat.class);
     FileOutputFormat.setOutputPath(job, OUTPUT_DIR);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDBOutputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDBOutputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDBOutputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDBOutputFormat.java
Sun Jun  6 01:28:10 2010
@@ -45,7 +45,7 @@ public class TestDBOutputFormat extends 
   }
   
   public void testSetOutput() throws IOException {
-    Job job = new Job(new Configuration());
+    Job job = Job.getInstance(new Configuration());
     DBOutputFormat.setOutput(job, "hadoop_output", fieldNames);
     
     DBConfiguration dbConf = new DBConfiguration(job.getConfiguration());
@@ -54,7 +54,7 @@ public class TestDBOutputFormat extends 
     
     assertEquals(expected, actual);
     
-    job = new Job(new Configuration());
+    job = Job.getInstance(new Configuration());
     dbConf = new DBConfiguration(job.getConfiguration());
     DBOutputFormat.setOutput(job, "hadoop_output", nullFieldNames.length);
     assertNull(dbConf.getOutputFieldNames());

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -196,7 +196,7 @@ public class TestDataDrivenDBInputFormat
     fs.delete(new Path(OUT_DIR), true);
 
     // now do a dd import
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     job.setMapperClass(ValMapper.class);
     job.setReducerClass(Reducer.class);
     job.setMapOutputKeyClass(DateCol.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestCombineFileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestCombineFileInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestCombineFileInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestCombineFileInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -276,7 +276,7 @@ public class TestCombineFileInputFormat 
 
       // split it using a CombinedFile input format
       DummyInputFormat inFormat = new DummyInputFormat();
-      Job job = new Job(conf);
+      Job job = Job.getInstance(conf);
       FileInputFormat.setInputPaths(job, dir1 + "," + dir2);
       inFormat.setMinSplitSizeRack(BLOCKSIZE);
       List<InputSplit> splits = inFormat.getSplits(job);
@@ -646,7 +646,7 @@ public class TestCombineFileInputFormat 
    */
   private void splitRealFiles(String[] args) throws IOException {
     Configuration conf = new Configuration();
-    Job job = new Job();
+    Job job = Job.getInstance();
     FileSystem fs = FileSystem.get(conf);
     if (!(fs instanceof DistributedFileSystem)) {
       throw new IOException("Wrong file system: " + fs.getClass().getName());

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestDelegatingInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestDelegatingInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestDelegatingInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestDelegatingInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -34,7 +34,7 @@ public class TestDelegatingInputFormat e
 
   @SuppressWarnings("unchecked")
   public void testSplitting() throws Exception {
-    Job job = new Job();
+    Job job = Job.getInstance();
     MiniDFSCluster dfs = null;
     try {
       dfs = new MiniDFSCluster(job.getConfiguration(), 4, true, new String[] { "/rack0",

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestFileInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestFileInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestFileInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestFileInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -39,7 +39,7 @@ public class TestFileInputFormat {
   public void testAddInputPath() throws IOException {
     final Configuration conf = new Configuration();
     conf.set("fs.default.name", "s3://abc:xyz@hostname/");
-    final Job j = new Job(conf);
+    final Job j = Job.getInstance(conf);
     j.getConfiguration().set("fs.default.name", "s3://abc:xyz@hostname/");
 
     //setup default fs

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -69,7 +69,7 @@ public class TestMRKeyValueTextInputForm
   
   @Test
   public void testFormat() throws Exception {
-    Job job = new Job(new Configuration(defaultConf));
+    Job job = Job.getInstance(new Configuration(defaultConf));
     Path file = new Path(workDir, "test.txt");
 
     int seed = new Random().nextInt();
@@ -157,7 +157,7 @@ public class TestMRKeyValueTextInputForm
 
   @Test
   public void testSplitableCodecs() throws Exception {
-    final Job job = new Job(defaultConf);
+    final Job job = Job.getInstance(defaultConf);
     final Configuration conf = job.getConfiguration();
 
     // Create the codec
@@ -338,7 +338,7 @@ public class TestMRKeyValueTextInputForm
               "fox jumped\nline-4\tover\nline-5\t the lazy\nline-6\t dog\n");
     writeFile(localFs, new Path(workDir, "part2.txt.gz"), gzip,
               "line-1\tthis is a test\nline-1\tof gzip\n");
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     FileInputFormat.setInputPaths(job, workDir);
     KeyValueTextInputFormat format = new KeyValueTextInputFormat();
     List<InputSplit> splits = format.getSplits(job);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsBinaryInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsBinaryInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsBinaryInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsBinaryInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -38,7 +38,7 @@ public class TestMRSequenceFileAsBinaryI
   private static final int RECORDS = 10000;
 
   public void testBinary() throws IOException, InterruptedException {
-    Job job = new Job();
+    Job job = Job.getInstance();
     FileSystem fs = FileSystem.getLocal(job.getConfiguration());
     Path dir = new Path(System.getProperty("test.build.data",".") + "/mapred");
     Path file = new Path(dir, "testbinary.seq");

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsTextInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsTextInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsTextInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileAsTextInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -38,7 +38,7 @@ public class TestMRSequenceFileAsTextInp
   private static Configuration conf = new Configuration();
 
   public void testFormat() throws Exception {
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     FileSystem fs = FileSystem.getLocal(conf);
     Path dir = new Path(System.getProperty("test.build.data",".") + "/mapred");
     Path file = new Path(dir, "test.seq");

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java
Sun Jun  6 01:28:10 2010
@@ -51,7 +51,7 @@ public class TestMRSequenceFileInputFilt
   
   static {
     try {
-      job = new Job(conf);
+      job = Job.getInstance(conf);
       FileInputFormat.setInputPaths(job, inDir);
       fs = FileSystem.getLocal(conf);
     } catch (IOException e) {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMultipleInputs.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMultipleInputs.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMultipleInputs.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestMultipleInputs.java
Sun Jun  6 01:28:10 2010
@@ -102,7 +102,7 @@ public class TestMultipleInputs extends 
     file2.writeBytes("a\tblah\nb\tblah\nc\tblah\nd\tblah\ne\tblah");
     file2.close();
 
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     job.setJobName("mi");
 
     MultipleInputs.addInputPath(job, in1Dir, TextInputFormat.class,
@@ -141,7 +141,7 @@ public class TestMultipleInputs extends 
 
   @SuppressWarnings("unchecked")
   public void testAddInputPathWithFormat() throws IOException {
-    final Job conf = new Job();
+    final Job conf = Job.getInstance();
     MultipleInputs.addInputPath(conf, new Path("/foo"), TextInputFormat.class);
     MultipleInputs.addInputPath(conf, new Path("/bar"),
         KeyValueTextInputFormat.class);
@@ -154,7 +154,7 @@ public class TestMultipleInputs extends 
 
   @SuppressWarnings("unchecked")
   public void testAddInputPathWithMapper() throws IOException {
-    final Job conf = new Job();
+    final Job conf = Job.getInstance();
     MultipleInputs.addInputPath(conf, new Path("/foo"), TextInputFormat.class,
        MapClass.class);
     MultipleInputs.addInputPath(conf, new Path("/bar"),

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestNLineInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestNLineInputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestNLineInputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestNLineInputFormat.java
Sun Jun  6 01:28:10 2010
@@ -47,7 +47,7 @@ public class TestNLineInputFormat extend
              "TestNLineInputFormat");
   
   public void testFormat() throws Exception {
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     Path file = new Path(workDir, "test.txt");
 
     int seed = new Random().nextInt();

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinDatamerge.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinDatamerge.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinDatamerge.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinDatamerge.java
Sun Jun  6 01:28:10 2010
@@ -255,7 +255,7 @@ public class TestJoinDatamerge extends T
     conf.set(CompositeInputFormat.JOIN_EXPR, CompositeInputFormat.compose(jointype,
         SequenceFileInputFormat.class, src));
     conf.setInt("testdatamerge.sources", srcs);
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     job.setInputFormatClass(CompositeInputFormat.class);
     FileOutputFormat.setOutputPath(job, new Path(base, "out"));
 
@@ -377,7 +377,7 @@ public class TestJoinDatamerge extends T
     MapReduceTestUtil.Fake_IF.setKeyClass(conf, IntWritable.class);
     MapReduceTestUtil.Fake_IF.setValClass(conf, IntWritable.class);
 
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     Path outf = new Path(base, "out");
     FileOutputFormat.setOutputPath(job, outf);
     job.setInputFormatClass(CompositeInputFormat.class);
@@ -430,7 +430,7 @@ public class TestJoinDatamerge extends T
         MapReduceTestUtil.Fake_IF.class, src));
     MapReduceTestUtil.Fake_IF.setKeyClass(conf, 
       MapReduceTestUtil.IncomparableKey.class);
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     job.setInputFormatClass(CompositeInputFormat.class);
     FileOutputFormat.setOutputPath(job, new Path(base, "out"));
 

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinProperties.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinProperties.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinProperties.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestJoinProperties.java
Sun Jun  6 01:28:10 2010
@@ -366,7 +366,7 @@ public class TestJoinProperties extends 
   public int testFormat(Configuration conf, int tupleSize,
       boolean firstTuple, boolean secondTuple, TestType ttype)
       throws Exception {
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     CompositeInputFormat format = new CompositeInputFormat();
     int count = 0;
     for (InputSplit split : (List<InputSplit>)format.getSplits(job)) {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestWrappedRRClassloader.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestWrappedRRClassloader.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestWrappedRRClassloader.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/join/TestWrappedRRClassloader.java
Sun Jun  6 01:28:10 2010
@@ -54,8 +54,9 @@ public class TestWrappedRRClassloader ex
     // create dummy TaskAttemptID
     TaskAttemptID tid = new TaskAttemptID("jt", 1, TaskType.MAP, 0, 0);
     conf.set(MRJobConfig.TASK_ATTEMPT_ID, tid.toString());
-    inputFormat.createRecordReader(inputFormat.getSplits(new Job(conf)).get(0), 
-      new TaskAttemptContextImpl(conf, tid));
+    inputFormat.createRecordReader
+      (inputFormat.getSplits(Job.getInstance(conf)).get(0), 
+       new TaskAttemptContextImpl(conf, tid));
   }
 
   public static class Fake_ClassLoader extends ClassLoader {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
Sun Jun  6 01:28:10 2010
@@ -71,7 +71,7 @@ public class TestFileOutputCommitter ext
 
   @SuppressWarnings("unchecked")
   public void testCommitter() throws Exception {
-    Job job = new Job();
+    Job job = Job.getInstance();
     FileOutputFormat.setOutputPath(job, outDir);
     Configuration conf = job.getConfiguration();
     conf.set(MRJobConfig.TASK_ATTEMPT_ID, attempt);
@@ -108,7 +108,7 @@ public class TestFileOutputCommitter ext
 
   @SuppressWarnings("unchecked")
   public void testAbort() throws IOException, InterruptedException {
-    Job job = new Job();
+    Job job = Job.getInstance();
     FileOutputFormat.setOutputPath(job, outDir);
     Configuration conf = job.getConfiguration();
     conf.set(MRJobConfig.TASK_ATTEMPT_ID, attempt);
@@ -157,7 +157,7 @@ public class TestFileOutputCommitter ext
 
   @SuppressWarnings("unchecked")
   public void testFailAbort() throws IOException, InterruptedException {
-    Job job = new Job();
+    Job job = Job.getInstance();
     Configuration conf = job.getConfiguration();
     conf.set(FileSystem.FS_DEFAULT_NAME_KEY, "faildel:///");
     conf.setClass("fs.faildel.impl", FakeFileSystem.class, FileSystem.class);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java?rev=951793&r1=951792&r2=951793&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java
Sun Jun  6 01:28:10 2010
@@ -50,7 +50,7 @@ public class TestMRSequenceFileAsBinaryO
   
   public void testBinary() throws IOException, InterruptedException {
     Configuration conf = new Configuration();
-    Job job = new Job(conf);
+    Job job = Job.getInstance(conf);
     
     Path outdir = new Path(System.getProperty("test.build.data", "/tmp"),
                     "outseq");
@@ -146,7 +146,7 @@ public class TestMRSequenceFileAsBinaryO
 
   public void testSequenceOutputClassDefaultsToMapRedOutputClass() 
          throws IOException {
-    Job job = new Job();
+    Job job = Job.getInstance();
     // Setting Random class to test getSequenceFileOutput{Key,Value}Class
     job.setOutputKeyClass(FloatWritable.class);
     job.setOutputValueClass(BooleanWritable.class);
@@ -174,7 +174,7 @@ public class TestMRSequenceFileAsBinaryO
 
   public void testcheckOutputSpecsForbidRecordCompression() 
       throws IOException {
-    Job job = new Job();
+    Job job = Job.getInstance();
     FileSystem fs = FileSystem.getLocal(job.getConfiguration());
     Path outputdir = new Path(System.getProperty("test.build.data", "/tmp") 
                               + "/output");



Mime
View raw message