= ralph

* http://github.com/sandofsky/ralph

== DESCRIPTION:

A pretty, simple wrapper for writing Hadoop Streaming jobs in Ruby.

== FEATURES/PROBLEMS:

* First version.

== SYNOPSIS:

Define your mappers and reducers in Ruby with the help of a domain specific language.

Ralph.job do

mapper do |row|
row.split(/\s/).each do |word|
emit word, 1
end
end

reducer do |key, values|
total = values.inject(0) {|t, i| t + i.to_i }
emit key, total
end

end

Then run you task with:

ralph fire word_count.rb input.csv output

Which would translate into:

hadoop jar $HADOOP_HOME/contrib/streaming/hadoop-*-streaming.jar \
-input input.csv \
-output output \
-mapper "ralph map word_count.rb" \
-reducer "ralph reduce word_count.rb" \
-file word_count.rb

== REQUIREMENTS:

* Make sure to export your $HADOOP_HOME as the path to hadoop.

== INSTALL:

* sudo gem install sandofsky-ralph --source http://gems.github.com

== LICENSE:

(The MIT License)

Copyright (c) 2009 FIX

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.