Skip to content

Commit

Permalink
license and README
Browse files Browse the repository at this point in the history
  • Loading branch information
beerriot committed Jan 20, 2011
1 parent 937c6c2 commit 3abcab6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Computing Baseball Stats using Riak Map/Reduce

* What is this?

This project is primarily an example of using Riak
(http://github.com/basho/riak) and luwak_mr
(http://github.com/beerriot/luwak_mr) to compute baseball statistics.

* How do I use it?

First, grab the game event files by decade from the Retrosheet
archive: http://www.retrosheet.org/game.htm. Unzip them into
usefully-named directories (e.g. "1950s").

Setup Riak, then clone luwak_mr and this project, build them, and add
them to Riak's code path.

Load the Retrosheet data into Riak by attaching to the Riak console
and using baseball:load_events(Directory), where Directory is the path
to one of your unzipped archives (e.g. "/home/bryan/baseball/1950s").

Compute the batting average for any player by attaching to the Riak
console and using baseball:batting_average(File, PlayerID), where File
is the last component of the path that you used in your load_events
call (e.g. 1950s), and PlayerID is the 8-character identifier of any
player (see the .ROS files in your unpacked archive, or the Retrosheet
docs for information about player IDs).
24 changes: 24 additions & 0 deletions src/baseball.erl
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
%% -------------------------------------------------------------------
%% baseball: utilities for computing baseball stats on Riak
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%%
%% -------------------------------------------------------------------

%% @doc Compute baseball stats using Riak Map/Reduce.
%%
%% This module works with data from the Retrosheet archive
%% (http://www.retrosheet.org/) to compute baseball statistics
%% (currently only batting average).
-module(baseball).

-export([
Expand Down

0 comments on commit 3abcab6

Please sign in to comment.