소스 검색

HADOOP-5976. Add a new command, classpath, to the hadoop script. Contributed by Owen O'Malley and Gary Murry

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@791937 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 년 전
부모
커밋
708f3fc781
3개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      CHANGES.txt
  2. 10 0
      bin/hadoop
  3. 9 0
      src/docs/src/documentation/content/xdocs/commands_manual.xml

+ 3 - 0
CHANGES.txt

@@ -154,6 +154,9 @@ Trunk (unreleased changes)
 
     HADOOP-3315. Add a new, binary file foramt, TFile. (Hong Tang via cdouglas)
 
+    HADOOP-5976. Add a new command, classpath, to the hadoop script.  (Owen
+    O'Malley and Gary Murry via szetszwo)
+
   IMPROVEMENTS
 
     HADOOP-4565. Added CombineFileInputFormat to use data locality information

+ 10 - 0
bin/hadoop

@@ -30,6 +30,8 @@ function print_usage(){
   echo "  jar <jar>            run a jar file"
   echo "  distcp <srcurl> <desturl> copy file or directories recursively"
   echo "  archive -archiveName NAME <src>* <dest> create a hadoop archive"
+  echo "  classpath            prints the class path needed to get the"
+  echo "                       Hadoop jar and the required libraries"
   echo "  daemonlog            get/set the log level for each daemon"
   echo " or"
   echo "  CLASSNAME            run the class named CLASSNAME"
@@ -72,6 +74,14 @@ case $COMMAND in
     fi
     ;;
 
+  classpath)
+    if $cygwin; then
+      CLASSPATH=`cygpath -p -w "$CLASSPATH"`
+    fi
+    echo $CLASSPATH
+    exit
+    ;;
+
   #core commands  
   *)
     # the core commands

+ 9 - 0
src/docs/src/documentation/content/xdocs/commands_manual.xml

@@ -410,6 +410,15 @@
 					 Runs the class named CLASSNAME.
 				</p>
 			</section>
+			<section>
+				<title> classpath </title>
+				<p>
+					Prints the class path needed to get the Hadoop jar and the required libraries.
+				</p>
+				<p>
+					<code>Usage: hadoop classpath</code>
+				</p>
+			</section>
     </section>
 		<section>
 			<title> Administration Commands </title>