Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1303#discussion_r146361770
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -292,38 +288,90 @@ function createRunDir()
         return 0
     }
     
    +function check_hadoop_install()
    +{
    +    local distro_type=${1}
    +    case "${distro_type}" in
    +        hdp|HDP)
    +            if [ -d "/usr/hdp/current/hadoop-client/client" ]; then
    +                DISTRO="hdp"
    +                return 0;
    +            fi
    +            ;;
    +        cdh|CDH)
    +            if [ -d "/usr/lib/hadoop/client" ]; then
    +                DISTRO="cdh"
    +                return 0;
    +            fi
    +            ;;
    +        tar|TAR)
    +            if [ -n "${HADOOP_ROOT}" ] && [ -d 
"${HADOOP_ROOT}/hadoop/share/hadoop/common/lib" ]; then
    +                DISTRO="tar"
    +                return 0;
    +            fi
    +            ;;
    +        custom|CUSTOM)
    +            # use tarball template for custom distro, do not require 
HADOOP_ROOT to be set
    +            DISTRO="tar"
    +            return 0;
    +            ;;
    +        *)
    +            fail "Unknown hadoop distribution type: 
HADOOP_DISTRO=${distro_type}"
    +            ;;
    +    esac
    +    # the distro type was not found installed, return failure code
    --- End diff --
    
    Maybe print error message, letting user know that no Hadoop is installed.


---

Reply via email to