hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1213907 - in /hadoop/common/trunk/hadoop-tools: ./ hadoop-archives/ hadoop-archives/src/ hadoop-archives/src/main/ hadoop-archives/src/main/java/ hadoop-archives/src/main/java/org/ hadoop-archives/src/main/java/org/apache/ hadoop-archives/...
Date Tue, 13 Dec 2011 20:18:00 GMT
Author: tucu
Date: Tue Dec 13 20:17:59 2011
New Revision: 1213907

URL: http://svn.apache.org/viewvc?rev=1213907&view=rev
Log:
HADOOP-7810. move hadoop archive to core from tools. (tucu)

Added:
    hadoop/common/trunk/hadoop-tools/hadoop-archives/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java
      - copied, changed from r1213889, hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/HadoopArchives.java
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/
    hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java
      - copied, changed from r1213889, hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/tools/TestHadoopArchives.java
Modified:
    hadoop/common/trunk/hadoop-tools/pom.xml

Copied: hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java
(from r1213889, hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/HadoopArchives.java)
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java?p2=hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java&p1=hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/HadoopArchives.java&r1=1213889&r2=1213907&rev=1213907&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/HadoopArchives.java
(original)
+++ hadoop/common/trunk/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java
Tue Dec 13 20:17:59 2011
@@ -111,6 +111,14 @@ public class HadoopArchives implements T
     } else {
       this.conf = new JobConf(conf, HadoopArchives.class);
     }
+
+    // This is for test purposes since MR2, different from Streaming
+    // here it is not possible to add a JAR to the classpath the tool
+    // will when running the mapreduce job.
+    String testJar = System.getProperty(TEST_HADOOP_ARCHIVES_JAR_PATH, null);
+    if (testJar != null) {
+      ((JobConf)conf).setJar(testJar);
+    }
   }
 
   public Configuration getConf() {
@@ -868,9 +876,12 @@ public class HadoopArchives implements T
     return 0;
   }
 
+  static final String TEST_HADOOP_ARCHIVES_JAR_PATH = "test.hadoop.archives.jar";
+
   /** the main functions **/
   public static void main(String[] args) {
     JobConf job = new JobConf(HadoopArchives.class);
+
     HadoopArchives harchives = new HadoopArchives(job);
     int ret = 0;
 

Copied: hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java
(from r1213889, hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/tools/TestHadoopArchives.java)
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java?p2=hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java&p1=hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/tools/TestHadoopArchives.java&r1=1213889&r2=1213907&rev=1213907&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/tools/TestHadoopArchives.java
(original)
+++ hadoop/common/trunk/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java
Tue Dec 13 20:17:59 2011
@@ -39,6 +39,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.mapred.MiniMRCluster;
+import org.apache.hadoop.util.JarFinder;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.log4j.Level;
 
@@ -46,6 +47,9 @@ import org.apache.log4j.Level;
  * test {@link HadoopArchives}
  */
 public class TestHadoopArchives extends TestCase {
+
+  public static final String HADOOP_ARCHIVES_JAR = JarFinder.getJar(HadoopArchives.class);
+
   {
     ((Log4JLogger)LogFactory.getLog(org.apache.hadoop.security.Groups.class)
         ).getLogger().setLevel(Level.OFF);
@@ -136,6 +140,7 @@ public class TestHadoopArchives extends 
           "*",
           archivePath.toString()
       };
+      System.setProperty(HadoopArchives.TEST_HADOOP_ARCHIVES_JAR_PATH, HADOOP_ARCHIVES_JAR);
       final HadoopArchives har = new HadoopArchives(mapred.createJobConf());
       assertEquals(0, ToolRunner.run(har, args));
 

Modified: hadoop/common/trunk/hadoop-tools/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-tools/pom.xml?rev=1213907&r1=1213906&r2=1213907&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-tools/pom.xml (original)
+++ hadoop/common/trunk/hadoop-tools/pom.xml Tue Dec 13 20:17:59 2011
@@ -29,6 +29,7 @@
 
   <modules>
     <module>hadoop-streaming</module>
+    <module>hadoop-archives</module>
   </modules>
 
   <build>



Mime
View raw message