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

    https://github.com/apache/incubator-hawq/pull/1303#discussion_r146362612
  
    --- 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 --
    
    good point, I wanted to do that too, but this function is called repeatedly 
from the logic below and in some cases it might go via HDP / CDH/ TAR calls 
consecutively, so erring out is not an option here and I believe informing user 
about failures of intermediate steps would be confusing.


---

Reply via email to