File tree 1 file changed +13
-4
lines changed 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 93
93
94
94
file_put_contents ($ jobsh , sprintf ('#!/bin/sh
95
95
confswitch=""
96
- while getopts ":c:" opt; do
96
+ streaming=""
97
+ while getopts ":c:s:" opt; do
97
98
case $opt in
98
99
c) confswitch="--config $OPTARG";;
100
+ s) streaming="$OPTARG";;
99
101
\?) echo "Invalid option: -$OPTARG"; exit 1;;
100
102
:) echo "Option -$OPTARG requires an argument."; exit 1;;
101
103
esac
104
106
105
107
if [ $# -lt 2 ]
106
108
then
107
- echo "Usage: $0 [-c HADOOPCONFDIR ] HDFSINPUTPATH... HDFSOUTPUTPATH"
109
+ echo "Usage: $0 [OPTION... ] HDFSINPUTPATH... HDFSOUTPUTPATH"
108
110
echo ""
109
111
echo "HDFSINPUTPATH can be repeated to use multiple paths as input for the job."
110
112
echo ""
111
113
echo "Options:"
112
114
echo " -c HADOOPCONFDIR Gets passed to hadoop via "--config" (see hadoop help)."
115
+ echo " -s STREAMINGJAR Path to hadoop-streaming-*.jar"
113
116
echo ""
114
117
exit 1
115
118
fi
131
134
if [ $HADOOP_HOME ]
132
135
then
133
136
hadoop=$HADOOP_HOME/bin/hadoop
134
- streaming=$HADOOP_HOME"/contrib/streaming/hadoop-streaming-*.jar"
137
+ if [ -z $streaming ]
138
+ then
139
+ streaming=$HADOOP_HOME"/contrib/streaming/hadoop-streaming-*.jar"
140
+ fi
135
141
else
136
142
hadoop="hadoop"
137
- streaming="/usr/lib/hadoop/contrib/streaming/hadoop-streaming-*.jar"
143
+ if [ -z $streaming ]
144
+ then
145
+ streaming="/usr/lib/hadoop/contrib/streaming/hadoop-streaming-*.jar"
146
+ fi
138
147
fi
139
148
dir=`dirname $0`
140
149
You can’t perform that action at this time.
0 commit comments