Repository: mahout Updated Branches: refs/heads/flink-binding da65cbe2b -> 1c1abbf3d
Merge branch 'mahoutworkdir' into MAHOUT-1794; pulling PR into a branch to work on. Project: http://git-wip-us.apache.org/repos/asf/mahout/repo Commit: http://git-wip-us.apache.org/repos/asf/mahout/commit/1c1abbf3 Tree: http://git-wip-us.apache.org/repos/asf/mahout/tree/1c1abbf3 Diff: http://git-wip-us.apache.org/repos/asf/mahout/diff/1c1abbf3 Branch: refs/heads/flink-binding Commit: 1c1abbf3d946c6a8082f089b3f49900450553578 Parents: da65cbe Author: Andrew Musselman <[email protected]> Authored: Thu Mar 17 18:34:41 2016 -0700 Committer: Andrew Musselman <[email protected]> Committed: Sat Mar 19 20:06:42 2016 -0700 ---------------------------------------------------------------------- examples/bin/classify-20newsgroups.sh | 8 ++++++-- examples/bin/classify-wikipedia.sh | 8 ++++++-- examples/bin/cluster-reuters.sh | 8 ++++++-- examples/bin/cluster-syntheticcontrol.sh | 6 +++++- examples/bin/factorize-movielens-1M.sh | 9 +++++++-- examples/bin/factorize-netflix.sh | 6 +++++- 6 files changed, 35 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/classify-20newsgroups.sh ---------------------------------------------------------------------- diff --git a/examples/bin/classify-20newsgroups.sh b/examples/bin/classify-20newsgroups.sh index c58e9a0..f47d5c5 100755 --- a/examples/bin/classify-20newsgroups.sh +++ b/examples/bin/classify-20newsgroups.sh @@ -36,7 +36,11 @@ START_PATH=`pwd` # Set commands for dfs source ${START_PATH}/set-dfs-commands.sh -WORK_DIR=/tmp/mahout-work-${USER} +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-${USER} +else + WORK_DIR=$MAHOUT_WORK_DIR +fi algorithm=( cnaivebayes-MapReduce naivebayes-MapReduce cnaivebayes-Spark naivebayes-Spark sgd clean) if [ -n "$1" ]; then choice=$1 @@ -105,7 +109,7 @@ if ( [ "x$alg" == "xnaivebayes-MapReduce" ] || [ "x$alg" == "xcnaivebayes-MapR echo "Copying 20newsgroups data to HDFS" set +e $DFSRM ${WORK_DIR}/20news-all - $DFS -mkdir ${WORK_DIR} + $DFS -mkdir -p ${WORK_DIR} $DFS -mkdir ${WORK_DIR}/20news-all set -e if [ $HVERSION -eq "1" ] ; then http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/classify-wikipedia.sh ---------------------------------------------------------------------- diff --git a/examples/bin/classify-wikipedia.sh b/examples/bin/classify-wikipedia.sh index 68487dc..8a7889f 100755 --- a/examples/bin/classify-wikipedia.sh +++ b/examples/bin/classify-wikipedia.sh @@ -42,7 +42,11 @@ START_PATH=`pwd` # Set commands for dfs source ${START_PATH}/set-dfs-commands.sh -WORK_DIR=/tmp/mahout-work-wiki +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-wiki +else + WORK_DIR=$MAHOUT_WORK_DIR +fi algorithm=( CBayes BinaryCBayes clean) if [ -n "$1" ]; then choice=$1 @@ -110,7 +114,7 @@ if [ "x$alg" == "xCBayes" ] || [ "x$alg" == "xBinaryCBayes" ] ; then echo "Copying wikipedia data to HDFS" set +e $DFSRM ${WORK_DIR}/wikixml - $DFS -mkdir ${WORK_DIR} + $DFS -mkdir -p ${WORK_DIR} set -e $DFS -put ${WORK_DIR}/wikixml ${WORK_DIR}/wikixml fi http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/cluster-reuters.sh ---------------------------------------------------------------------- diff --git a/examples/bin/cluster-reuters.sh b/examples/bin/cluster-reuters.sh index d53aa00..49f6c94 100755 --- a/examples/bin/cluster-reuters.sh +++ b/examples/bin/cluster-reuters.sh @@ -43,7 +43,11 @@ if [ ! -e $MAHOUT ]; then exit 1 fi -WORK_DIR=/tmp/mahout-work-${USER} +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-${USER} +else + WORK_DIR=$MAHOUT_WORK_DIR +fi algorithm=( kmeans fuzzykmeans lda streamingkmeans clean) if [ -n "$1" ]; then @@ -98,7 +102,7 @@ if [ ! -e ${WORK_DIR}/reuters-out-seqdir ]; then set +e $DFSRM ${WORK_DIR}/reuters-sgm $DFSRM ${WORK_DIR}/reuters-out - $DFS -mkdir ${WORK_DIR}/ + $DFS -mkdir -p ${WORK_DIR}/ $DFS -mkdir ${WORK_DIR}/reuters-sgm $DFS -mkdir ${WORK_DIR}/reuters-out $DFS -put ${WORK_DIR}/reuters-sgm ${WORK_DIR}/reuters-sgm http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/cluster-syntheticcontrol.sh ---------------------------------------------------------------------- diff --git a/examples/bin/cluster-syntheticcontrol.sh b/examples/bin/cluster-syntheticcontrol.sh index 39f5784..8f37cc6 100755 --- a/examples/bin/cluster-syntheticcontrol.sh +++ b/examples/bin/cluster-syntheticcontrol.sh @@ -48,7 +48,11 @@ START_PATH=`pwd` # Set commands for dfs source ${START_PATH}/set-dfs-commands.sh -WORK_DIR=/tmp/mahout-work-${USER} +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-${USER} +else + WORK_DIR=$MAHOUT_WORK_DIR +fi echo "creating work directory at ${WORK_DIR}" mkdir -p ${WORK_DIR} http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/factorize-movielens-1M.sh ---------------------------------------------------------------------- diff --git a/examples/bin/factorize-movielens-1M.sh b/examples/bin/factorize-movielens-1M.sh index 735e425..29730e1 100755 --- a/examples/bin/factorize-movielens-1M.sh +++ b/examples/bin/factorize-movielens-1M.sh @@ -43,7 +43,12 @@ fi export MAHOUT_LOCAL=true MAHOUT="$MAHOUT_HOME/bin/mahout" -WORK_DIR=/tmp/mahout-work-${USER} +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-${USER} +else + WORK_DIR=$MAHOUT_WORK_DIR +fi + echo "creating work directory at ${WORK_DIR}" mkdir -p ${WORK_DIR}/movielens @@ -77,4 +82,4 @@ shuf ${WORK_DIR}/recommendations/part-m-00000 |head echo -e "\n\n" echo "removing work directory" -rm -rf ${WORK_DIR} \ No newline at end of file +rm -rf ${WORK_DIR} http://git-wip-us.apache.org/repos/asf/mahout/blob/1c1abbf3/examples/bin/factorize-netflix.sh ---------------------------------------------------------------------- diff --git a/examples/bin/factorize-netflix.sh b/examples/bin/factorize-netflix.sh index 856f775..26faf66 100755 --- a/examples/bin/factorize-netflix.sh +++ b/examples/bin/factorize-netflix.sh @@ -45,7 +45,11 @@ fi MAHOUT="../../bin/mahout" -WORK_DIR=/tmp/mahout-work-${USER} +if [[ -z "$MAHOUT_WORK_DIR" ]]; then + WORK_DIR=/tmp/mahout-work-${USER} +else + WORK_DIR=$MAHOUT_WORK_DIR +fi START_PATH=`pwd`
