hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject hadoop git commit: HDFS-7591. hdfs classpath command should support same options as hadoop classpath. (Contributed by Varun Saxena)
Date Fri, 16 Jan 2015 17:39:06 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 651c7debe -> f72e2bfed


HDFS-7591. hdfs classpath command should support same options as hadoop classpath. (Contributed
by Varun Saxena)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f72e2bfe
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f72e2bfe
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f72e2bfe

Branch: refs/heads/branch-2
Commit: f72e2bfedd717555f0a5398b209d7bf08c6ab838
Parents: 651c7de
Author: Arpit Agarwal <arp@apache.org>
Authored: Fri Jan 16 09:37:54 2015 -0800
Committer: Arpit Agarwal <arp@apache.org>
Committed: Fri Jan 16 09:37:54 2015 -0800

----------------------------------------------------------------------
 .../hadoop-common/src/main/bin/hadoop                  |  6 +++---
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt            |  3 +++
 hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs      | 12 ++++++++++++
 hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd  | 13 ++++++++++++-
 4 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f72e2bfe/hadoop-common-project/hadoop-common/src/main/bin/hadoop
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
index 518e407..bc33198 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
@@ -129,15 +129,15 @@ case $COMMAND in
     elif [ "$COMMAND" = "trace" ] ; then
       CLASS=org.apache.hadoop.tracing.TraceAdmin
     elif [ "$COMMAND" = "classpath" ] ; then
-      if [ "$#" -eq 1 ]; then
+      if [ "$#" -gt 1 ]; then
+        CLASS=org.apache.hadoop.util.Classpath
+      else
         # No need to bother starting up a JVM for this simple case.
         if $cygwin; then
           CLASSPATH=$(cygpath -p -w "$CLASSPATH" 2>/dev/null)
         fi
         echo $CLASSPATH
         exit
-      else
-        CLASS=org.apache.hadoop.util.Classpath
       fi
     elif [[ "$COMMAND" = -*  ]] ; then
         # class and package names cannot begin with a -

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f72e2bfe/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 803a454..6d21a76 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -250,6 +250,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7189. Add trace spans for DFSClient metadata operations. (Colin P.
     McCabe via yliu)
 
+    HDFS-7591. hdfs classpath command should support same options as hadoop
+    classpath. (Varun Saxena via Arpit Agarwal)
+
   OPTIMIZATIONS
 
     HDFS-7454. Reduce memory footprint for AclEntries in NameNode.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f72e2bfe/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
index 3a450ae..dabef18 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs
@@ -43,6 +43,7 @@ function print_usage(){
   echo "Usage: hdfs [--config confdir] [--loglevel loglevel] COMMAND"
   echo "       where COMMAND is one of:"
   echo "  dfs                  run a filesystem command on the file systems supported in
Hadoop."
+  echo "  classpath            prints the classpath"
   echo "  namenode -format     format the DFS filesystem"
   echo "  secondarynamenode    run the DFS secondary namenode"
   echo "  namenode             run the DFS namenode"
@@ -207,6 +208,17 @@ elif [ "$COMMAND" = "version" ] ; then
   CLASS=org.apache.hadoop.util.VersionInfo
 elif [ "$COMMAND" = "debug" ]; then
   CLASS=org.apache.hadoop.hdfs.tools.DebugAdmin
+elif [ "$COMMAND" = "classpath" ]; then
+  if [ "$#" -gt 0 ]; then
+    CLASS=org.apache.hadoop.util.Classpath
+  else
+    # No need to bother starting up a JVM for this simple case.
+    if $cygwin; then
+      CLASSPATH=$(cygpath -p -w "$CLASSPATH" 2>/dev/null)
+    fi
+    echo $CLASSPATH
+    exit 0
+  fi
 else
   CLASS="$COMMAND"
 fi

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f72e2bfe/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd
index 851637d..d52f52e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs.cmd
@@ -51,7 +51,14 @@ if "%1" == "--loglevel" (
       goto print_usage
   )
 
-  set hdfscommands=dfs namenode secondarynamenode journalnode zkfc datanode dfsadmin haadmin
fsck balancer jmxget oiv oev fetchdt getconf groups snapshotDiff lsSnapshottableDir cacheadmin
mover storagepolicies
+  if %hdfs-command% == classpath (
+    if not defined hdfs-command-arguments (
+      @rem No need to bother starting up a JVM for this simple case.
+      @echo %CLASSPATH%
+      exit /b
+    )
+  )
+  set hdfscommands=dfs namenode secondarynamenode journalnode zkfc datanode dfsadmin haadmin
fsck balancer jmxget oiv oev fetchdt getconf groups snapshotDiff lsSnapshottableDir cacheadmin
mover storagepolicies classpath
   for %%i in ( %hdfscommands% ) do (
     if %hdfs-command% == %%i set hdfscommand=true
   )
@@ -122,6 +129,10 @@ goto :eof
   set CLASS=org.apache.hadoop.hdfs.tools.JMXGet
   goto :eof
 
+:classpath
+  set CLASS=org.apache.hadoop.util.Classpath
+  goto :eof
+
 :oiv
   set CLASS=org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewerPB
   goto :eof


Mime
View raw message