minor, 'hadoop fs' command add conf parameter Signed-off-by: Hongbin Ma <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/bb278915 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/bb278915 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/bb278915 Branch: refs/heads/master-hbase0.98 Commit: bb2789156668f699d0c5f85bb578d5d0997fbde1 Parents: 693c6fa Author: Roger Shi <[email protected]> Authored: Fri Feb 24 19:13:59 2017 +0800 Committer: Hongbin Ma <[email protected]> Committed: Fri Feb 24 19:49:02 2017 +0800 ---------------------------------------------------------------------- build/bin/check-env.sh | 11 +++++++++-- build/bin/sample.sh | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/bb278915/build/bin/check-env.sh ---------------------------------------------------------------------- diff --git a/build/bin/check-env.sh b/build/bin/check-env.sh index e446d66..a0e91c4 100644 --- a/build/bin/check-env.sh +++ b/build/bin/check-env.sh @@ -18,6 +18,13 @@ # source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/header.sh +source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/find-hadoop-conf-dir.sh + +if [ -z "${kylin_hadoop_conf_dir}" ]; then + hadoop_conf_param= +else + hadoop_conf_param="--config ${kylin_hadoop_conf_dir}" +fi if [ -z "$KYLIN_HOME" ] then @@ -42,13 +49,13 @@ then fi WORKING_DIR=`bash $KYLIN_HOME/bin/get-properties.sh kylin.env.hdfs-working-dir` -hadoop fs -mkdir -p $WORKING_DIR +hadoop ${hadoop_conf_param} fs -mkdir -p $WORKING_DIR if [ $? != 0 ] then quit "Failed to create $WORKING_DIR. Please make sure the user has right to access $WORKING_DIR" fi -hadoop fs -mkdir -p $WORKING_DIR/spark-history +hadoop ${hadoop_conf_param} fs -mkdir -p $WORKING_DIR/spark-history if [ $? != 0 ] then quit "Failed to create $WORKING_DIR/spark-history. Please make sure the user has right to access $WORKING_DIR" http://git-wip-us.apache.org/repos/asf/kylin/blob/bb278915/build/bin/sample.sh ---------------------------------------------------------------------- diff --git a/build/bin/sample.sh b/build/bin/sample.sh index 2c87956..4c65bcf 100644 --- a/build/bin/sample.sh +++ b/build/bin/sample.sh @@ -18,15 +18,22 @@ # source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/header.sh +source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/find-hadoop-conf-dir.sh source ${dir}/check-env.sh "if-not-yet" job_jar=`find -L ${KYLIN_HOME}/lib/ -name kylin-job*.jar` cd ${KYLIN_HOME}/sample_cube/data +if [ -z "${kylin_hadoop_conf_dir}" ]; then + hadoop_conf_param= +else + hadoop_conf_param="--config ${kylin_hadoop_conf_dir}" +fi + echo "Loading sample data into HDFS tmp path: /tmp/kylin/sample_cube/data" -hadoop fs -mkdir -p /tmp/kylin/sample_cube/data -hadoop fs -put * /tmp/kylin/sample_cube/data/ +hadoop ${hadoop_conf_param} fs -mkdir -p /tmp/kylin/sample_cube/data +hadoop ${hadoop_conf_param} fs -put * /tmp/kylin/sample_cube/data/ hive_client_mode=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.client` sample_database=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.source.hive.database-for-flat-table` @@ -45,7 +52,7 @@ else fi echo "Sample hive tables are created successfully; Going to create sample cube..." -hadoop fs -rm -r /tmp/kylin/sample_cube +hadoop ${hadoop_conf_param} fs -rm -r /tmp/kylin/sample_cube # set engine type and storage type to cube desc default_engine_type=`bash ${KYLIN_HOME}/bin/get-properties.sh kylin.engine.default`
