workflow-streaming.xml.mako 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ## Licensed to Cloudera, Inc. under one
  2. ## or more contributor license agreements. See the NOTICE file
  3. ## distributed with this work for additional information
  4. ## regarding copyright ownership. Cloudera, Inc. licenses this file
  5. ## to you under the Apache License, Version 2.0 (the
  6. ## "License"); you may not use this file except in compliance
  7. ## with the License. You may obtain a copy of the License at
  8. ##
  9. ## http://www.apache.org/licenses/LICENSE-2.0
  10. ##
  11. ## Unless required by applicable law or agreed to in writing, software
  12. ## distributed under the License is distributed on an "AS IS" BASIS,
  13. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ## See the License for the specific language governing permissions and
  15. ## limitations under the License.
  16. <%namespace name="common" file="workflow-common.xml.mako" />
  17. <%!
  18. try:
  19. import json
  20. except ImportError:
  21. import simplejson as json
  22. %>
  23. <%
  24. streaming = design.get_root_action()
  25. properties = json.loads(streaming.job_properties)
  26. files = json.loads(streaming.files)
  27. archives = json.loads(streaming.archives)
  28. %>
  29. <workflow-app xmlns="uri:oozie:workflow:0.2" name="${design.name}">
  30. <start to="root-node"/>
  31. <action name="root-node">
  32. <map-reduce>
  33. ## Do not hardcode the jobtracker/resourcemanager address.
  34. ## We want to be flexible where to submit it to.
  35. <job-tracker>${'${'}jobTracker}</job-tracker>
  36. <name-node>${nameNode}</name-node>
  37. <streaming>
  38. <mapper>${streaming.mapper}</mapper>
  39. <reducer>${streaming.reducer}</reducer>
  40. </streaming>
  41. ${common.configuration(properties)}
  42. ${common.distributed_cache(files, archives)}
  43. </map-reduce>
  44. <ok to="end"/>
  45. <error to="fail"/>
  46. </action>
  47. <kill name="fail">
  48. <message>Streaming failed, error message[${'${'}wf:errorMessage(wf:lastErrorNode())}]</message>
  49. </kill>
  50. <end name="end"/>
  51. </workflow-app>