Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (39 sloc) 5.305 kb
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
1 # Riak Function Contrib
2
b139fb0 README tweaks
Mark Phillips authored
3 Riak Function Contrib is a community-powered library of MapReduce, Pre-/Post-Commit Hook, and other functions. It exists for several reasons:
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
4
b139fb0 README tweaks
Mark Phillips authored
5 1. So Riak users can contribute functions they've written back to the community in one centralized, easy-to-manage location
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
6 2. To provide users who are new to Riak with a list of previously-created and tested functions that may suit their usage needs
7 3. To lower the barrier to entry to using and mastering MapReduce and Pre-/Post-Commit Hook Functions in Riak
8
9 ## Usage
10
b139fb0 README tweaks
Mark Phillips authored
11 To use the code in this repo you can either browse the source files of the functions in the directory of your choice or head over to the [Riak Function Contrib site](http://contrib.basho.com) to search for useful code and read in depth descriptions provided by function authors.
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
12
13 ## Issues or Questions
5d61b67 @schofield added back logo, oops
schofield authored
14
b139fb0 README tweaks
Mark Phillips authored
15 If, at any point, you have a question or issue, email _mark@basho.com_ or join the [Riak Mailing List](http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com) and submit your question there.
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
16
17 ## Contributing
18
b139fb0 README tweaks
Mark Phillips authored
19 Have a function to share with the rest of the Riak Community? Great. Here is how you do it:
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
20
21 1. Fork this repo to your own GitHub account (You can read up on forking [here](http://help.github.com/forking/) if you need a refresher)
22 2. Add your function source file to the appropriate repo (explained in depth below)
23 3. Add your overview file to the appropriate repo (again, explained below)
24 4. Send a pull request
b139fb0 README tweaks
Mark Phillips authored
25 5. Kick back, smile, and relish in the fact that your functions are helping Riak users everywhere
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
26
27 ### Your Function Source File
28
b139fb0 README tweaks
Mark Phillips authored
29 Step 2 above is "Add your function source file to the appropriate repo." The MapReduce Functions live in the `mapreduce` repo, and are broken up by languages (Erlang or JavaScript). Pre- and Post- Commit source code lives in the `hooks` directory and is broken down by type (Pre and Post). For instance, if you have a JavaScript MapReduce Function to contribute, it will [live in this directory](https://github.com/basho/riak_function_contrib/tree/master/mapreduce/js/).
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
30
31 **What should the source file contain?**
32
b139fb0 README tweaks
Mark Phillips authored
33 1. _Apache 2.0 License Boilerplate_. All files submitted to the Riak Function Contrib Repo must include the Apache 2.0 boilerplate. If you're unfamiliar with the Apache license and how to include it in your code, please take a moment and read up on it [here](http://www.apache.org/licenses/LICENSE-2.0.html).
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
34
35 2. Your code. This is fairly self-explanatory. In addition to the code, make sure to include adequate comments and notation. [Here's a great example](https://github.com/basho/riak_function_contrib/blob/master/mapreduce/js/sorting-by-field.js).
36
b139fb0 README tweaks
Mark Phillips authored
37 ### Your Overview File
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
38
b139fb0 README tweaks
Mark Phillips authored
39 In addition to your source, you're encourage to take a few minutes and put together an overview file. Why? Because your contribution to Riak Function Contrib will visible in two locations: 1) as part of the actual code repo in the form of your source file and 2) as an overview page on the [Riak Function Contrib site](http://contrib.basho.com) For example, the overview page for [this function](https://github.com/basho/riak_function_contrib/blob/master/mapreduce/js/sorting-by-field.js) lives
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
40 [here](http://contrib.basho.com/sorting-by-field.html)
41
b139fb0 README tweaks
Mark Phillips authored
42 This is actually pretty simple. We use [Gollum](https://github.com/github/gollum) to generate this site. What that means is that your overview file can be written in either [Markdown](http://en.wikipedia.org/wiki/Markdown) or [Textile](http://en.wikipedia.org/wiki/Textile_(markup_language). Gollum will take care of converting them to html and, once you've sent the pull request, we'll regenerate the site and make sure your contribution goes live.
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
43
b139fb0 README tweaks
Mark Phillips authored
44 And, since we are using Gollum, you can build the site locally to make sure everything looks right before you send your pull request. Specifically, here's what you need to do:
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
45
46 1. [Install Gollum](https://github.com/github/gollum)
b139fb0 README tweaks
Mark Phillips authored
47 2. [Install Gollum Site](https://github.com/dreverri/gollum-site) (This is a simple static site generator for Gollum written by Basho's very own Dan Reverri)
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
48 3. cd into your local copy of the Riak Function Contrib repo
b139fb0 README tweaks
Mark Phillips authored
49 4. `$ gollum-site generate && gollum-site serve`
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
50 5. Head to http://localhost:8000/
51
b139fb0 README tweaks
Mark Phillips authored
52 This should get the site running locally and you should be able to view your additions. **You must commit your changes locally in order for Gollum to generate them**
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
53
54 ### A General Note on File Naming
55
56 Try to name your source file in such a way that it describes what the function might be used for. For example, if the code is a JavaScript reduce function that is good for filtering out large objects, you might name it "large-object-filter-reduce.js"
57
b139fb0 README tweaks
Mark Phillips authored
58 Also, be sure to name your overview file with the same name as your source file (save for the extension, of course). So, to continue with the example given above, if your source file is named "large-object-filter-reduce.js" you would name your overview file "large-object-filter-reduce.textile"
59
60 ## Other Resources
61
ffe5fe3 more readme tweaking
Mark Phillips authored
62 * [MapReduce on the Riak Wiki](http://wiki.basho.com/display/RIAK/MapReduce)
63 * [Pre- and Post-Commit Hooks on the Riak Wiki](http://wiki.basho.com/display/RIAK/Pre-+and+Post-Commit+Hooks)
64 * [The Riak Fast Track](http://wiki.basho.com/display/RIAK/The+Riak+Fast+Track)
3162e52 @schofield initial commit to riak_function_contrib
schofield authored
65
66
67
68
Something went wrong with that request. Please try again.