mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 04:29:59 +08:00
SQOOP-180. Classpath construction in script.
(Aaron Kimball via Arvind Prabhakar) From: Arvind Prabhakar <arvind@cloudera.com> git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1150019 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9db0f3b4a9
commit
349f707f39
@ -37,9 +37,6 @@ fi
|
|||||||
if [ -z "${HBASE_HOME}" ]; then
|
if [ -z "${HBASE_HOME}" ]; then
|
||||||
HBASE_HOME=/usr/lib/hbase
|
HBASE_HOME=/usr/lib/hbase
|
||||||
fi
|
fi
|
||||||
if [ -z "${ZOOKEEPER_HOME}" ]; then
|
|
||||||
ZOOKEEPER_HOME=/usr/lib/zookeeper
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check: If we can't find our dependencies, give up here.
|
# Check: If we can't find our dependencies, give up here.
|
||||||
if [ ! -d "${HADOOP_HOME}" ]; then
|
if [ ! -d "${HADOOP_HOME}" ]; then
|
||||||
@ -52,11 +49,6 @@ if [ ! -d "${HBASE_HOME}" ]; then
|
|||||||
echo 'Please set $HBASE_HOME to the root of your HBase installation.'
|
echo 'Please set $HBASE_HOME to the root of your HBase installation.'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ ! -d "${ZOOKEEPER_HOME}" ]; then
|
|
||||||
echo "Error: $ZOOKEEPER_HOME does not exist!"
|
|
||||||
echo 'Please set $ZOOKEEPER_HOME to the root of your ZooKeeper installation.'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Where to find the main Sqoop jar
|
# Where to find the main Sqoop jar
|
||||||
@ -84,14 +76,12 @@ if [ -d "$SQOOP_HOME/lib" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Add HBase to dependency list
|
# Add HBase to dependency list
|
||||||
add_to_classpath $HBASE_HOME
|
SQOOP_CLASSPATH=`$HBASE_HOME/bin/hbase classpath`:${SQOOP_CLASSPATH}
|
||||||
add_to_classpath $HBASE_HOME/lib
|
|
||||||
|
|
||||||
HBASE_CONF_DIR=${HBASE_CONF_DIR:-${HBASE_HOME}/conf}
|
ZOOCFGDIR=${ZOOCFGDIR:-/etc/zookeeper}
|
||||||
SQOOP_CLASSPATH=${HBASE_CONF_DIR}:${SQOOP_CLASSPATH}
|
if [ -d "${ZOOCFGDIR}" ]; then
|
||||||
|
SQOOP_CLASSPATH=$ZOOCFGDIR:$SQOOP_CLASSPATH
|
||||||
add_to_classpath $ZOOKEEPER_HOME
|
fi
|
||||||
add_to_classpath $ZOOKEEPER_HOME/lib
|
|
||||||
|
|
||||||
SQOOP_CONF_DIR=${SQOOP_CONF_DIR:-${SQOOP_HOME}/conf}
|
SQOOP_CONF_DIR=${SQOOP_CONF_DIR:-${SQOOP_HOME}/conf}
|
||||||
SQOOP_CLASSPATH=${SQOOP_CONF_DIR}:${SQOOP_CLASSPATH}
|
SQOOP_CLASSPATH=${SQOOP_CONF_DIR}:${SQOOP_CLASSPATH}
|
||||||
@ -105,10 +95,17 @@ fi
|
|||||||
|
|
||||||
add_to_classpath ${SQOOP_JAR_DIR}
|
add_to_classpath ${SQOOP_JAR_DIR}
|
||||||
|
|
||||||
|
HADOOP_CLASSPATH="${SQOOP_CLASSPATH}:${HADOOP_CLASSPATH}"
|
||||||
|
if [ ! -z "$SQOOP_USER_CLASSPATH" ]; then
|
||||||
|
# User has elements to prepend to the classpath, forcibly overriding
|
||||||
|
# Sqoop's own lib directories.
|
||||||
|
export HADOOP_CLASSPATH="${SQOOP_USER_CLASSPATH}:${HADOOP_CLASSPATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
export SQOOP_CLASSPATH
|
export SQOOP_CLASSPATH
|
||||||
export SQOOP_CONF_DIR
|
export SQOOP_CONF_DIR
|
||||||
export SQOOP_JAR_DIR
|
export SQOOP_JAR_DIR
|
||||||
export HADOOP_CLASSPATH="${SQOOP_CLASSPATH}:${HADOOP_CLASSPATH}"
|
export HADOOP_CLASSPATH
|
||||||
export HADOOP_HOME
|
export HADOOP_HOME
|
||||||
export HBASE_HOME
|
export HBASE_HOME
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user