gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whjiang <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request: fix GEARPUMP-117 add scripts to s...
Date Mon, 23 May 2016 09:51:53 GMT
Github user whjiang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/23#discussion_r64195757
  
    --- Diff: bin/config.sh ---
    @@ -0,0 +1,84 @@
    +#!/usr/bin/env bash
    +
    +GEARPUMP_PID_DIR=""                                 # Directory to store *.pid files
to
    +DEFAULT_ENV_PID_DIR="/tmp"                          # Default directory to store *.pid
files to
    +
    +GEARPUMP_LOG_DIR=""
    +DEFAULT_ENV_LOG_DIR="/tmp/gear-logs"
    +
    +if [ "$GEARPUMP_PID_DIR" = "" ]; then
    +    GEARPUMP_PID_DIR=${DEFAULT_ENV_PID_DIR}
    +fi
    +
    +if [ "$GEARPUMP_LOG_DIR" = "" ]; then
    +    GEARPUMP_LOG_DIR=${DEFAULT_ENV_LOG_DIR}
    +fi
    +
    +bin=`dirname "$0"`
    +SYMLINK_RESOLVED=`cd "$bin"; pwd -P`
    +
    +# Define the main directory of the gearpump installation
    +export GEAR_ROOT_DIR=`dirname "$SYMLINK_RESOLVED"`
    +export GEAR_BIN_DIR="$GEAR_ROOT_DIR/bin"
    +export GEAR_CONF_DIR="$GEAR_ROOT_DIR/conf"
    +
    +readMasters() {
    +    MASTERS_FILE="${GEAR_CONF_DIR}/masters"
    +
    +    if [[ ! -f "${MASTERS_FILE}" ]]; then
    +        echo "No masters file. Please specify masters in 'conf/masters'."
    +        exit 1
    +    fi
    +
    +    MASTERS=()
    +    MASTERPORTS=()
    +
    +    while IFS='' read -r line || [[ -n "$line" ]]; do
    +        HOSTPORT=$( extractHostName $line)
    +
    +        if [ -n "$HOSTPORT" ]; then
    +            HOST=$(echo $HOSTPORT | cut -f1 -d:)
    +            PORT=$(echo $HOSTPORT | cut -s -f2 -d:)
    +            MASTERS+=(${HOST})
    +
    +            if [ -z "$PORT" ]; then
    +                MASTERPORTS+=(3000)
    +            else
    +                MASTERPORTS+=(${PORT})
    +            fi
    +        fi
    +    done < "$MASTERS_FILE"
    +}
    +
    +readSlaves() {
    +    SLAVES_FILE="${GEAR_CONF_DIR}/slaves"
    --- End diff --
    
    better to make naming consistent. E.g. Gearpump has "worker", but not "slave". So, it
is better to rename "slaves" to "workers".


---
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