From eea383ff2e725c2c5807261be3ae57992cd3c3e8 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Mon, 29 Sep 2014 18:10:47 -0700 Subject: [PATCH] HDFS-6779. Add missing version subcommand for hdfs. Contributed by Sasaki Toru. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs | 5 ++++- .../hadoop-hdfs/src/site/apt/HDFSCommands.apt.vm | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 2bb6ad8e40e..5df88d30e58 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -267,6 +267,9 @@ Release 2.6.0 - UNRELEASED HDFS-7124. Remove EncryptionZoneManager.NULL_EZ. (clamb via wang) + HDFS-6779. Add missing version subcommand for hdfs. + (Sasaki Toru via wheat9) + OPTIMIZATIONS HDFS-6690. Deduplicate xattr names in memory. (wang) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs index b5af54ec63b..3d88fb19788 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs @@ -65,6 +65,7 @@ function print_usage(){ echo " cacheadmin configure the HDFS cache" echo " crypto configure HDFS encryption zones" echo " storagepolicies get all the existing block storage policies" + echo " version print the version" echo "" echo "Most commands print help when invoked w/o parameters." } @@ -112,7 +113,7 @@ if [ "$COMMAND" == "nfs3" ] && [ "$EUID" -eq 0 ] && [ -n "$HADOOP_PRIVILEGED_NFS if [ -n "$HADOOP_PRIVILEGED_NFS_PID_DIR" ]; then HADOOP_PID_DIR=$HADOOP_PRIVILEGED_NFS_PID_DIR fi - + if [ -n "$HADOOP_PRIVILEGED_NFS_LOG_DIR" ]; then HADOOP_LOG_DIR=$HADOOP_PRIVILEGED_NFS_LOG_DIR HADOOP_OPTS="$HADOOP_OPTS -Dhadoop.log.dir=$HADOOP_LOG_DIR" @@ -195,6 +196,8 @@ elif [ "$COMMAND" = "cacheadmin" ] ; then CLASS=org.apache.hadoop.hdfs.tools.CacheAdmin elif [ "$COMMAND" = "crypto" ] ; then CLASS=org.apache.hadoop.hdfs.tools.CryptoAdmin +elif [ "$COMMAND" = "version" ] ; then + CLASS=org.apache.hadoop.util.VersionInfo else CLASS="$COMMAND" fi diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HDFSCommands.apt.vm b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HDFSCommands.apt.vm index 1e73377c5ca..70851105c52 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HDFSCommands.apt.vm +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/HDFSCommands.apt.vm @@ -114,6 +114,12 @@ HDFS Commands Guide | -racks | Print out network topology for data-node locations. *------------------------+---------------------------------------------+ +** <<>> + + Prints the version. + + Usage: <<>> + * Administration Commands Commands useful for administrators of a hadoop cluster.