buyingyi | c73348c | 2012-11-02 00:31:31 +0000 | [diff] [blame] | 1 | # Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | # contributor license agreements. See the NOTICE file distributed with |
| 3 | # this work for additional information regarding copyright ownership. |
| 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | # (the "License"); you may not use this file except in compliance with |
| 6 | # the License. You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # |
| 17 | # processes --config option from command line |
| 18 | # |
| 19 | |
| 20 | this="$0" |
| 21 | while [ -h "$this" ]; do |
| 22 | ls=`ls -ld "$this"` |
| 23 | link=`expr "$ls" : '.*-> \(.*\)$'` |
| 24 | if expr "$link" : '.*/.*' > /dev/null; then |
| 25 | this="$link" |
| 26 | else |
| 27 | this=`dirname "$this"`/"$link" |
| 28 | fi |
| 29 | done |
| 30 | |
| 31 | # convert relative path to absolute path |
| 32 | bin=`dirname "$this"` |
| 33 | script=`basename "$this"` |
| 34 | bin=`cd "$bin"; pwd` |
| 35 | this="$bin/$script" |
| 36 | |
| 37 | # the root of the Hadoop installation |
| 38 | export HIVE_HOME=`dirname "$bin"` |
| 39 | |
| 40 | #check to see if the conf dir is given as an optional argument |
| 41 | while [ $# -gt 0 ]; do # Until you run out of parameters . . . |
| 42 | case "$1" in |
| 43 | --config) |
| 44 | shift |
| 45 | confdir=$1 |
| 46 | shift |
| 47 | HIVE_CONF_DIR=$confdir |
| 48 | ;; |
| 49 | --auxpath) |
| 50 | shift |
| 51 | HIVE_AUX_JARS_PATH=$1 |
| 52 | shift |
| 53 | ;; |
| 54 | *) |
| 55 | break; |
| 56 | ;; |
| 57 | esac |
| 58 | done |
| 59 | |
| 60 | |
| 61 | # Allow alternate conf dir location. |
| 62 | HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf}" |
| 63 | |
| 64 | export HIVE_CONF_DIR=$HIVE_CONF_DIR |
| 65 | export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH |
| 66 | |
| 67 | # Default to use 256MB |
| 68 | export HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-256} |