Skip to content

Commit

Permalink
#5 Keep
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Westergaard Lassen committed Mar 23, 2013
1 parent aada337 commit c0844f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/mapred.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ <h1>MapReduce</h1>
<input id="timeout" type="number" ng-model="job.timeout"/>
</div>
</div>
<h2>query</h2>
<div>

<h2>Queries</h2>
<div class="well well-small">
<tabs>
<pane ng-repeat="phase in job.query" heading="{{$index+1}}: {{getPhaseType(phase)}}">
<div class="control-group">
Expand All @@ -29,6 +30,11 @@ <h2>query</h2>
<textarea id="source{{$index}}" ng-model="getPhase(phase).source" rows="10" style="width: 95%"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox"><input type="checkbox" ng-model="getPhase(phase).keep"> <span tooltip="Include in final result?">Keep</span></label>
</div>
</div>
</pane>
</tabs>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/mapred.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
{
"map": {
"language": "javascript",
"source": "function(riakObject) {\n\treturn [riakObject.key]\n}"
"source": "function(riakObject) {\n\treturn [riakObject.key]\n}",
"keep": false
}
},
{
"reduce": {
"language": "javascript",
"source": "function(values) {\n\tvar r = []\n\tfor (var i = 0; i < values.length; i++) {\n\t\tvar v = values[i];\n\t\tif (v.match(/mapred.+\\.json/g)) {\n\t\t\tr.push(v);\n\t\t}\n\t}\n\treturn r\n}"
"source": "function(values) {\n\tvar r = []\n\tfor (var i = 0; i < values.length; i++) {\n\t\tvar v = values[i];\n\t\tif (v.match(/mapred.+\\.json/g)) {\n\t\t\tr.push(v);\n\t\t}\n\t}\n\treturn r\n}",
"keep": true
}
}
],
Expand Down

0 comments on commit c0844f0

Please sign in to comment.