blob: 2524bbcc941084cbc750f3c077faa18f280face5 [file] [log] [blame]
buyingyic73348c2012-11-02 00:31:31 +00001# 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
20this="$0"
21while [ -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
29done
30
31# convert relative path to absolute path
32bin=`dirname "$this"`
33script=`basename "$this"`
34bin=`cd "$bin"; pwd`
35this="$bin/$script"
36
37# the root of the Hadoop installation
38export HIVE_HOME=`dirname "$bin"`
39
40#check to see if the conf dir is given as an optional argument
41while [ $# -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
58done
59
60
61# Allow alternate conf dir location.
62HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf}"
63
64export HIVE_CONF_DIR=$HIVE_CONF_DIR
65export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH
66
67# Default to use 256MB
68export HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-256}