소스 검색

HADOOP-11150. hadoop command should show the reason on failure by invalid COMMAND or CLASSNAME (Masatake Iwasaki via aw)

Allen Wittenauer 10 년 전
부모
커밋
aee68b67f3
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      hadoop-common-project/hadoop-common/CHANGES.txt
  2. 3 0
      hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -138,6 +138,9 @@ Trunk (Unreleased)
     HADOOP-11025. hadoop-daemons.sh should just call hdfs directly (Masatake
     Iwasaki via aw)
 
+    HADOOP-11150. hadoop command should show the reason on failure by 
+    invalid COMMAND or CLASSNAME (Masatake Iwasaki via aw)
+
   BUG FIXES
 
     HADOOP-9451. Fault single-layer config if node group topology is enabled.

+ 3 - 0
hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

@@ -286,6 +286,9 @@ function hadoop_validate_classname
   shift 1
 
   if [[ ! ${class} =~ \. ]]; then
+    # assuming the arg is typo of command if it does not conatain ".".
+    # class belonging to no package is not allowed as a result.
+    hadoop_error "ERROR: ${class} is not COMMAND nor fully qualified CLASSNAME."
     return 1
   fi
   return 0