wikimedia/puppet-cdh4 — pull request #13 by supertom (2013-03-29 02:15:32+00:00)
Title: mapred-site.xml differences for MR1 vs. MR2

In mapred-site.xml, if one is using yarn, the properties names different than if using mr1

For example, if using yarn:
mapreduce.tasktracker.map.tasks.maximum
mapreduce.tasktracker.reduce.tasks.maximum
if not using yarn, the property names are:
mapred.tasktracker.map.tasks.maximum
mapred.tasktracker.reduce.tasks.maximum

In my example above, if you use the "yarn" properties with the "non-yarn" configuration, they are not picked up by hadoop (as witnessed by me in CDH 4.2.0). They will both default to 2.

There are a couple of ways to handle this. You could keep it all in one file and do a series of these:
```ruby
<% if @map_tasks_maximum -%>

- mapreduce.tasktracker.map.tasks.maximum
- <%= map_tasks_maximum %>
+ <% if @use_yarn == true-%>
+ mapreduce.tasktracker.map.tasks.maximum
+ <% else -%>
+ mapred.tasktracker.map.tasks.maximum
+ <% end -%>
+ <%= map_tasks_maximum %>

<% end -%>

<% if @reduce_tasks_maximum -%>

+ <% @use_yarn == true -%>
mapreduce.tasktracker.reduce.tasks.maximum
+ <% else -%>
+ mapred.tasktracker.reduce.tasks.maximum
+ <% end -%>
<%= reduce_tasks_maximum %>

<% end -%>
```

or, you can just break it into two files (one for mr1 and one for mr2), which is what the pull request does. The properties aren't one for one, and the names aren't necessarily consistent, so I recommend splitting it into multiple files now before it becomes burdensome.

Please let me know if you have any questions.

Thanks,

Tom