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