Permalink
Browse files

update PathUtils

  • Loading branch information...
1 parent a963d8d commit cc03b1c6f3f85861d3eabb28c6bd6aadf624ad5e @leejianwei leejianwei committed Jun 6, 2012
@@ -37,7 +37,7 @@
<job id="wc-job"
input-path="/user/hadoop/input"
- output-path="#{@pathUtils.format()}"
+ output-path="#{ T(org.springframework.data.hadoop.util.PathUtils).format('/user/hadoop/output/%1$tY/%1$tm/%1$td/%1$tH/%1$tM/%1$tS')}"
mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"
validate-paths="false"
@@ -58,12 +58,6 @@
<beans:property name="to" value="leejianwei@126.com"></beans:property>
</beans:bean>
- <beans:bean name="pathUtils" class="org.springframework.data.hadoop.util.PathUtils"
- p:rootPath="/user/hadoop/output"
- p:pathFormat="yyyy/MM/dd/HH/mm/ss"/>
-
-
-
<script-tasklet id="script-tasklet">
<script language="groovy">
// 'hack' default permissions to make Hadoop work on Windows
@@ -30,13 +30,9 @@
<tasklet id="wordcount-tasklet" job-ref="wc-job"/>
- <beans:bean name="pathUtils" class="org.springframework.data.hadoop.util.PathUtils"
- p:rootPath="/user/hadoop/output"
- p:pathFormat="yyyy/MM/dd/HH/mm/ss"/>
-
<job id="wc-job"
input-path="/user/hadoop/input"
- output-path="#{@pathUtils.format()}"
+ output-path="#{ T(org.springframework.data.hadoop.util.PathUtils).format('/user/hadoop/output/%1$tY/%1$tm/%1$td/%1$tH/%1$tM/%1$tS')}"
mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"
validate-paths="false"
@@ -25,12 +25,9 @@
<tasklet id="wordcount-tasklet" job-ref="wordcount-job" />
- <beans:bean name="pathUtils"
- class="org.springframework.data.hadoop.util.PathUtils" p:rootPath="${wordcount-job.output.path}"
- p:pathFormat="yyyy/MM/dd/HH/mm/ss" />
-
<job id="wordcount-job" input-path="${wordcount-job.input.path}"
- output-path="#{@pathUtils.format()}" mapper="${wordcount-job.mapper.class}"
+ output-path="#{ T(org.springframework.data.hadoop.util.PathUtils).format('/user/hadoop/output/%1$tY/%1$tm/%1$td/%1$tH/%1$tM/%1$tS')}"
+ mapper="${wordcount-job.mapper.class}"
reducer="${wordcount-job.reducer.class}"
jar="${wordcount-job.jar.path}" validate-paths="false" />

0 comments on commit cc03b1c

Please sign in to comment.