drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudheeshkatkam <...@git.apache.org>
Subject [GitHub] drill pull request #547: Drill-4581: Extensive revisions to the Drill launch...
Date Thu, 21 Jul 2016 01:02:45 GMT
Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/547#discussion_r71633184
  
    --- Diff: distribution/src/resources/drill-config.sh ---
    @@ -50,94 +70,252 @@ home=`cd "$bin/..">/dev/null; pwd`
     this="$home/bin/$script"
     
     # the root of the drill installation
    -if [ -z "$DRILL_HOME" ]; then
    -  DRILL_HOME="$home"
    -fi
    +DRILL_HOME=${DRILL_HOME:-$home}
     
    -#check to see if the conf dir or drill home are given as an optional arguments
    -while [ $# -gt 1 ]; do
    -  if [ "--config" = "$1" ]; then
    +# Standardize error messages
    +
    +fatal_error() {
    +  echo "ERROR: $@" 1>&2
    +  exit 1
    +}
    +
    +# Check to see if the conf dir or drill home are given as an optional arguments
    +# Arguments may appear anywhere on the command line. --site is an alias, better
    +# specifies that the location contains all site-specific files, not just config.
    +#
    +# Remaining arguments go into the args array - use that instead of $@.
    +
    +args=()
    +while [[ $# > 0 ]]
    +do
    +  arg="$1"
    +  case "$arg" in
    +  --site|--config)
         shift
    -    confdir=$1
    +    DRILL_CONF_DIR=$1
         shift
    -    DRILL_CONF_DIR=$confdir
    -  else
    -    # Presume we are at end of options and break
    -    break
    -  fi
    +    ;;
    +  *)
    +    args+=("$1")
    +    shift
    +    ;;
    +  esac
     done
    +export args
    +
    +# If config dir is given, it must exist.
    +
    +if [ -n "$DRILL_CONF_DIR" ]; then
    +  if [[ ! -d "$DRILL_CONF_DIR" ]]; then
    +    fatal_error "Config dir does not exist:" $DRILL_CONF_DIR
    +  fi
    +else
     
    -# Allow alternate drill conf dir location.
    -DRILL_CONF_DIR="${DRILL_CONF_DIR:-/etc/drill/conf}"
    +  # Allow alternate drill conf dir location.
    +  DRILL_CONF_DIR="/etc/drill/conf"
     
    -if [ ! -d $DRILL_CONF_DIR ]; then
    -  DRILL_CONF_DIR=$DRILL_HOME/conf
    +  # Otherwise, use the default
    +  if [[ ! -d "$DRILL_CONF_DIR" ]]; then
    +    DRILL_CONF_DIR="$DRILL_HOME/conf"
    +  fi
    +fi
    +
    +# However we got the config dir, it must contain a config
    +# file, and that file must be readable.
    +# Most files are optional, so check the one that is required:
    +# drill-override.conf.
    +
    +testFile="$DRILL_CONF_DIR/drill-override.conf"
    +if [[ ! -a "$testFile" ]]; then
    +  fatal_error "Drill config file missing: $testFile -- Wrong config dir?"
    +fi
    +if [[ ! -r "$testFile" ]]; then
    +  fatal_error "Drill config file not readable: $testFile - Wrong user?"
    +fi
    +
    +# Set Drill-provided defaults here. Do not put Drill defaults
    +# in the distribution or user environment config files.
    +
    +# The SQLline client does not need the code cache.
    +
    +export SQLLINE_JAVA_OPTS=${SQLLINE_JAVA_OPTS:-"-XX:MaxPermSize=512M"}
    +
    +# Class unloading is disabled by default in Java 7
    +# http://hg.openjdk.java.net/jdk7u/jdk7u60/hotspot/file/tip/src/share/vm/runtime/globals.hpp#l1622
    +export SERVER_GC_OPTS="$SERVER_GC_OPTS -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC"
    +
    +# No GC options by default for SQLLine
    +export CLIENT_GC_OPTS=${CLIENT_GC_OPTS:-""}
    +
    +# Source the optional drill-env.sh for any user configured values.
    +# We read the file only in the $DRILL_CONF_DIR, which might be a
    +# site-specific folder. By design, we do not search both the site
    +# folder and the $DRILL_HOME/conf folder; we look in just the one
    +# identified by $DRILL_CONF_DIR.
    +#
    +# Note: the env files must set properties as follows for "inheritance"
    +# to work correctly:
    +#
    +# export FOO=${FOO:-"value"}
    +
    +drillEnv="$DRILL_CONF_DIR/drill-env.sh"
    +if [ -r "$drillEnv" ]; then
    +  . "$drillEnv"
     fi
     
    -# Source drill-env.sh for any user configured values
    -. "${DRILL_CONF_DIR}/drill-env.sh"
    +# Source distrib-env.sh for any distribution-specific settings.
    +# distrib-env.sh is optional; it is created by some distribution installers
    +# that need distribution-specific settings.
    +
    +distribEnv="$DRILL_HOME/conf/distrib-env.sh"
    +if [ -r "$distribEnv" ]; then
    --- End diff --
    
    Should this throw an error or warning otherwise?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message