Repository: mahout
Updated Branches:
  refs/heads/master 23267a0be -> b25a70a1b


Support environment variable MAHOUT_WORK_DIR to allow users to
specify an alternate temporary directory in examples.


Project: http://git-wip-us.apache.org/repos/asf/mahout/repo
Commit: http://git-wip-us.apache.org/repos/asf/mahout/commit/89e19c75
Tree: http://git-wip-us.apache.org/repos/asf/mahout/tree/89e19c75
Diff: http://git-wip-us.apache.org/repos/asf/mahout/diff/89e19c75

Branch: refs/heads/master
Commit: 89e19c75e80fd9523af5eb208cc13674db7a847f
Parents: 99d8ce2
Author: Albert Chu <[email protected]>
Authored: Mon Nov 16 16:43:42 2015 -0800
Committer: Albert Chu <[email protected]>
Committed: Thu Nov 19 13:45:45 2015 -0800

----------------------------------------------------------------------
 examples/bin/classify-20newsgroups.sh    | 6 +++++-
 examples/bin/classify-wikipedia.sh       | 6 +++++-
 examples/bin/cluster-reuters.sh          | 6 +++++-
 examples/bin/cluster-syntheticcontrol.sh | 6 +++++-
 examples/bin/factorize-movielens-1M.sh   | 9 +++++++--
 examples/bin/factorize-netflix.sh        | 6 +++++-
 6 files changed, 32 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mahout/blob/89e19c75/examples/bin/classify-20newsgroups.sh
----------------------------------------------------------------------
diff --git a/examples/bin/classify-20newsgroups.sh 
b/examples/bin/classify-20newsgroups.sh
index c58e9a0..6d7ab45 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

http://git-wip-us.apache.org/repos/asf/mahout/blob/89e19c75/examples/bin/classify-wikipedia.sh
----------------------------------------------------------------------
diff --git a/examples/bin/classify-wikipedia.sh 
b/examples/bin/classify-wikipedia.sh
index 68487dc..686c99d 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

http://git-wip-us.apache.org/repos/asf/mahout/blob/89e19c75/examples/bin/cluster-reuters.sh
----------------------------------------------------------------------
diff --git a/examples/bin/cluster-reuters.sh b/examples/bin/cluster-reuters.sh
index d53aa00..6c42ab9 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

http://git-wip-us.apache.org/repos/asf/mahout/blob/89e19c75/examples/bin/cluster-syntheticcontrol.sh
----------------------------------------------------------------------
diff --git a/examples/bin/cluster-syntheticcontrol.sh 
b/examples/bin/cluster-syntheticcontrol.sh
index eab62be..5e1240f 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/89e19c75/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/89e19c75/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`
 

Reply via email to