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: HADOOP-11668. hadoop-daemons.sh bw compat broke with --slaves change (Vinayakumar B via aw)
Date Tue, 10 Mar 2015 05:31:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 47f7f18d4 -> 771104983


HADOOP-11668. hadoop-daemons.sh bw compat broke with --slaves change (Vinayakumar B via aw)


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

Branch: refs/heads/trunk
Commit: 7711049837d69d0eeabad27f2e30fab606a4adc2
Parents: 47f7f18
Author: Allen Wittenauer <aw@apache.org>
Authored: Mon Mar 9 22:31:50 2015 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Mon Mar 9 22:31:50 2015 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt       |  3 +++
 .../hadoop-common/src/main/bin/hadoop-daemons.sh      | 13 +++++++++----
 .../hadoop-common/src/main/bin/hadoop-functions.sh    | 14 +++++++++++++-
 hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh   | 13 +++++++++----
 4 files changed, 34 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/77110498/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index f831d1a..7d0cbee 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -423,6 +423,9 @@ Trunk (Unreleased)
     HADOOP-11653. shellprofiles should require .sh extension
     (Brahma Reddy Battula via aw)
 
+    HADOOP-11668. hadoop-daemons.sh bw compat broke with --slaves change
+    (Vinayakumar B via aw)
+
   OPTIMIZATIONS
 
     HADOOP-7761. Improve the performance of raw comparisons. (todd)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/77110498/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh
index 9e4e6b0..2619ab7 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh
@@ -65,8 +65,13 @@ hadoop_error "WARNING: Attempting to execute replacement \"hdfs --slaves
--daemo
 # we're going to turn this into
 #  hdfs --slaves --daemon (start|stop) (rest of options)
 #
-argv=(${HADOOP_USER_PARAMS[@]/start})
-argv=(${argv[@]/stop})
-argv=(${argv[@]/status})
+for (( i = 0; i < ${#HADOOP_USER_PARAMS[@]}; i++ ))
+do
+  if [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^start$ ]] ||
+     [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^stop$ ]] ||
+     [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^status$ ]]; then
+    unset HADOOP_USER_PARAMS[$i]
+  fi
+done
 
-${hdfsscript} --slaves --daemon "${daemonmode}" "${argv[@]}"
+${hdfsscript} --slaves --daemon "${daemonmode}" "${HADOOP_USER_PARAMS[@]}"

http://git-wip-us.apache.org/repos/asf/hadoop/blob/77110498/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
index 9488e3c..8129c5c 100644
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
@@ -415,7 +415,19 @@ function hadoop_common_slave_mode_execute
 
   # if --slaves is still on the command line, remove it
   # to prevent loops
-  argv=(${argv[@]/--slaves})
+  # Also remove --hostnames and --hosts along with arg values
+  local argsSize=${#argv[@]};
+  for (( i = 0; i < $argsSize; i++ ))
+  do
+    if [[ "${argv[$i]}" =~ ^--slaves$ ]]; then
+      unset argv[$i]
+    elif [[ "${argv[$i]}" =~ ^--hostnames$ ]] ||
+      [[ "${argv[$i]}" =~ ^--hosts$ ]]; then
+      unset argv[$i];
+      let i++;
+      unset argv[$i];
+    fi
+  done
   hadoop_connect_to_hosts -- "${argv[@]}"
 }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/77110498/hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh b/hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh
index c6963d9..75fb1f8 100644
--- a/hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh
+++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn-daemons.sh
@@ -55,9 +55,14 @@ hadoop_error "WARNING: Attempting to execute replacement \"yarn --slaves
--daemo
 # we're going to turn this into
 #  yarn --slaves --daemon (start|stop) (rest of options)
 #
-argv=(${HADOOP_USER_PARAMS[@]/start})
-argv=(${argv[@]/stop})
-argv=(${argv[@]/status})
+for (( i = 0; i < ${#HADOOP_USER_PARAMS[@]}; i++ ))
+do
+  if [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^start$ ]] ||
+     [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^stop$ ]] ||
+     [[ "${HADOOP_USER_PARAMS[$i]}" =~ ^status$ ]]; then
+    unset HADOOP_USER_PARAMS[$i]
+  fi
+done
 
-${yarnscript} --slaves --daemon "${daemonmode}" "${argv[@]}"
+${yarnscript} --slaves --daemon "${daemonmode}" "${HADOOP_USER_PARAMS[@]}"
 


Mime
View raw message