瀏覽代碼

HDDS-631. Ozone classpath shell command is not working. Contributed by Elek, Marton.

Márton Elek 6 年之前
父節點
當前提交
194f0b49fb
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      hadoop-ozone/common/src/main/bin/ozone

+ 14 - 1
hadoop-ozone/common/src/main/bin/ozone

@@ -69,7 +69,20 @@ function ozonecmd_case
       OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-tools"
     ;;
     classpath)
-      hadoop_do_classpath_subcommand HADOOP_CLASSNAME "$@"
+      if [[ "$#" -gt 0 ]]; then
+        OZONE_RUN_ARTIFACT_NAME="$1"
+        HADOOP_CLASSNAME="org.apache.hadoop.util.Classpath"
+        #remove the artifact name and replace it with glob
+        # (We need at least one argument to execute the Classpath helper class)
+        HADOOP_SUBCMD_ARGS[0]="--glob"
+      else
+        hadoop_finalize
+        echo "Usage: ozone classpath <ARTIFACTNAME>"
+        echo "Where the artifact name is one of:"
+        echo ""
+        ls -1 ${HADOOP_HDFS_HOME}/share/ozone/classpath/ | sed 's/.classpath//'
+        exit -1
+      fi
     ;;
     datanode)
       HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true"