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 | 98e9a9b | 2013-03-10 21:24:35 +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 | THISSERVICE=hwi |
| 31 | export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} " |
| 32 | |
| 33 | hwi() { |
| 34 | |
| 35 | if $cygwin; then |
| 36 | HIVE_LIB=`cygpath -w "$HIVE_LIB"` |
| 37 | fi |
| 38 | |
| 39 | CLASS=org.apache.hadoop.hive.hwi.HWIServer |
| 40 | # The ls hack forces the * to be expanded which is required because |
| 41 | # System.getenv doesn't do globbing |
| 42 | export HWI_JAR_FILE=$(ls ${HIVE_LIB}/hive-hwi-*.jar) |
| 43 | export HWI_WAR_FILE=$(ls ${HIVE_LIB}/hive-hwi-*.war) |
| 44 | |
| 45 | #hwi requires ant jars |
| 46 | if [ "$ANT_LIB" = "" ] ; then |
| 47 | ANT_LIB=/opt/ant/lib |
| 48 | fi |
| 49 | for f in ${ANT_LIB}/*.jar; do |
| 50 | if [[ ! -f $f ]]; then |
| 51 | continue; |
| 52 | fi |
| 53 | HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:$f |
| 54 | done |
| 55 | |
| 56 | export HADOOP_CLASSPATH |
| 57 | |
| 58 | # hadoop 20 or newer - skip the aux_jars option and hiveconf |
| 59 | exec $HADOOP jar ${HWI_JAR_FILE} $CLASS $HIVE_OPTS "$@" |
| 60 | } |
| 61 | |
| 62 | hwi_help(){ |
| 63 | echo "Usage ANT_LIB=XXXX hive --service hwi" |
| 64 | } |