Browse Source

HADOOP-700. Change bin/hadoop to only include core jar file on classpath. Contributed by Nigel.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@493146 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
1b4eb642fc

+ 5 - 0
CHANGES.txt

@@ -195,6 +195,11 @@ Trunk (unreleased changes)
 55. HADOOP-470.  In HDFS web ui, list the datanodes containing each
     copy of a block.  (Hairong Kuang via cutting)
 
+56. HADOOP-700.  Change bin/hadoop to only include core jar file on
+    classpath, not example, test, etc.  Also rename core jar to
+    hadoop-${version}-core.jar so that it can be more easily
+    identified.  (Nigel Daley via cutting)
+
 
 Release 0.9.2 - 2006-12-15
 

+ 2 - 2
bin/hadoop

@@ -90,11 +90,11 @@ fi
 # so that filenames w/ spaces are handled correctly in loops below
 IFS=
 
-# for releases, add hadoop jars & webapps to CLASSPATH
+# for releases, add core hadoop jar & webapps to CLASSPATH
 if [ -d "$HADOOP_HOME/webapps" ]; then
   CLASSPATH=${CLASSPATH}:$HADOOP_HOME
 fi
-for f in $HADOOP_HOME/hadoop-*.jar; do
+for f in $HADOOP_HOME/hadoop-*-core.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 

+ 2 - 2
bin/rcc

@@ -52,11 +52,11 @@ fi
 # so that filenames w/ spaces are handled correctly in loops below
 IFS=
 
-# for releases, add hadoop jars & webapps to CLASSPATH
+# for releases, add core hadoop jar & webapps to CLASSPATH
 if [ -d "$HADOOP_HOME/webapps" ]; then
   CLASSPATH=${CLASSPATH}:$HADOOP_HOME
 fi
-for f in $HADOOP_HOME/hadoop-*.jar; do
+for f in $HADOOP_HOME/hadoop-*-core.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 

+ 2 - 2
build.xml

@@ -262,7 +262,7 @@
     <tar compression="gzip" destfile="${build.classes}/bin.tgz">
       <tarfileset dir="bin" mode="755"/>
     </tar>
-    <jar jarfile="${build.dir}/${final.name}.jar"
+    <jar jarfile="${build.dir}/${final.name}-core.jar"
          basedir="${build.classes}">
       <manifest>
         <section name="org/apache/hadoop">
@@ -488,7 +488,7 @@
       <fileset dir="${build.webapps}"/>
     </copy>
 
-    <copy file="${build.dir}/${final.name}.jar" todir="${dist.dir}"/>
+    <copy file="${build.dir}/${final.name}-core.jar" todir="${dist.dir}"/>
 
     <copy file="${build.dir}/${final.name}-examples.jar" todir="${dist.dir}"/>
     

+ 3 - 3
src/test/org/apache/hadoop/fs/TestFileSystem.java

@@ -182,7 +182,7 @@ public class TestFileSystem extends TestCase {
     fs.delete(DATA_DIR);
     fs.delete(WRITE_DIR);
     
-    JobConf job = new JobConf(conf);
+    JobConf job = new JobConf(conf, TestFileSystem.class);
     job.setBoolean("fs.test.fastCheck", fastCheck);
 
     job.setInputPath(CONTROL_DIR);
@@ -277,7 +277,7 @@ public class TestFileSystem extends TestCase {
 
     fs.delete(READ_DIR);
 
-    JobConf job = new JobConf(conf);
+    JobConf job = new JobConf(conf, TestFileSystem.class);
     job.setBoolean("fs.test.fastCheck", fastCheck);
 
 
@@ -373,7 +373,7 @@ public class TestFileSystem extends TestCase {
 
     fs.delete(READ_DIR);
 
-    JobConf job = new JobConf(conf);
+    JobConf job = new JobConf(conf, TestFileSystem.class);
     job.setBoolean("fs.test.fastCheck", fastCheck);
 
     job.setInputPath(CONTROL_DIR);

+ 5 - 5
src/test/org/apache/hadoop/mapred/TestMapRed.java

@@ -272,7 +272,7 @@ public class TestMapRed extends TestCase {
                                   boolean compressReduceOutput,
                                   boolean includeCombine
                                   ) throws Exception {
-      JobConf conf = new JobConf();
+      JobConf conf = new JobConf(TestMapRed.class);
       Path testdir = new Path("build/test/test.mapred.compress");
       Path inDir = new Path(testdir, "in");
       Path outDir = new Path(testdir, "out");
@@ -341,7 +341,7 @@ public class TestMapRed extends TestCase {
         //
         // Generate distribution of ints.  This is the answer key.
         //
-        JobConf conf = new JobConf();
+        JobConf conf = new JobConf(TestMapRed.class);
         int countsToGo = counts;
         int dist[] = new int[range];
         for (int i = 0; i < range; i++) {
@@ -402,7 +402,7 @@ public class TestMapRed extends TestCase {
         fs.delete(randomOuts);
 
 
-        JobConf genJob = new JobConf(conf);
+        JobConf genJob = new JobConf(conf,TestMapRed.class);
         genJob.setInputPath(randomIns);
         genJob.setInputFormat(SequenceFileInputFormat.class);
         genJob.setMapperClass(RandomGenMapper.class);
@@ -447,7 +447,7 @@ public class TestMapRed extends TestCase {
         int intermediateReduces = 10;
         Path intermediateOuts = new Path(testdir, "intermediateouts");
         fs.delete(intermediateOuts);
-        JobConf checkJob = new JobConf(conf);
+        JobConf checkJob = new JobConf(conf,TestMapRed.class);
         checkJob.setInputPath(randomOuts);
         checkJob.setInputFormat(TextInputFormat.class);
         checkJob.setMapperClass(RandomCheckMapper.class);
@@ -470,7 +470,7 @@ public class TestMapRed extends TestCase {
         //
         Path finalOuts = new Path(testdir, "finalouts");        
         fs.delete(finalOuts);
-        JobConf mergeJob = new JobConf(conf);
+        JobConf mergeJob = new JobConf(conf,TestMapRed.class);
         mergeJob.setInputPath(intermediateOuts);
         mergeJob.setInputFormat(SequenceFileInputFormat.class);
         mergeJob.setMapperClass(MergeMapper.class);

+ 3 - 3
src/test/org/apache/hadoop/record/test/TestMapRed.java

@@ -295,7 +295,7 @@ public class TestMapRed extends TestCase {
         fs.delete(randomOuts);
 
 
-        JobConf genJob = new JobConf(conf);
+        JobConf genJob = new JobConf(conf,TestMapRed.class);
         genJob.setInputPath(randomIns);
         genJob.setInputKeyClass(RecInt.class);
         genJob.setInputValueClass(RecInt.class);
@@ -342,7 +342,7 @@ public class TestMapRed extends TestCase {
         int intermediateReduces = 10;
         Path intermediateOuts = new Path(testdir, "intermediateouts");
         fs.delete(intermediateOuts);
-        JobConf checkJob = new JobConf(conf);
+        JobConf checkJob = new JobConf(conf,TestMapRed.class);
         checkJob.setInputPath(randomOuts);
         checkJob.setInputKeyClass(RecInt.class);
         checkJob.setInputValueClass(RecString.class);
@@ -367,7 +367,7 @@ public class TestMapRed extends TestCase {
         //
         Path finalOuts = new Path(testdir, "finalouts");        
         fs.delete(finalOuts);
-        JobConf mergeJob = new JobConf(conf);
+        JobConf mergeJob = new JobConf(conf,TestMapRed.class);
         mergeJob.setInputPath(intermediateOuts);
         mergeJob.setInputKeyClass(RecInt.class);
         mergeJob.setInputValueClass(RecString.class);