Giter Site home page Giter Site logo

riak_function_contrib's Introduction

Riak Function Contrib

Riak Function Contrib is a community-powered library of MapReduce, Pre-/Post-Commit Hook, and other functions. It exists for several reasons:

  1. So Riak users can contribute functions they've written back to the community in one centralized, easy-to-manage location
  2. To provide users who are new to Riak with a list of previously-created and tested functions that may suit their usage needs
  3. To lower the barrier to entry to using and mastering MapReduce and Pre-/Post-Commit Hook Functions in Riak

Usage

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 wiki to search for useful code and read in depth descriptions provided by function authors.

Issues or Questions

If, at any point, you have a question or issue, please post to the Riak Mailing List and submit your question there.

Contributing

Have a function to share with the rest of the Riak Community? Great. Here is how you do it:

  1. Fork this repo to your own GitHub account (You can read up on forking here if you need a refresher)
  2. Branch from master and add your function source file to the appropriate directory (explained in depth below)
  3. Send a pull request against the master branch from your branch
  4. Create your docs branch based on the wiki upstream branch, and add your overview file (again, explained below)
  5. Send a pull request against the wiki branch for your docs contribution
  6. Kick back, smile, and relish in the fact that your functions are helping Riak users everywhere

Your Function Source File

Step 2 above is "Add your function source file to the appropriate directory." The MapReduce Functions live in the mapreduce directory, 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.

What should the source file contain?

  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.

  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.

Your Overview File

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 wiki For example, the overview page for this function lives here

A General Note on File Naming

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

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.md

riak_function_contrib's People

Contributors

aphyr avatar beerriot avatar eriksoe avatar fakepop avatar hal-eisen avatar jpease avatar lenary avatar lukebakken avatar peschkaj avatar roidrage avatar schofield avatar seancribbs avatar subnetmarco avatar whitenode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

riak_function_contrib's Issues

Enhance Sidebar navigation

The sidebar nav should be changed to use the same js and dropdown design that the wiki.basho.com uses.

Delete_keys failing to compile

Hi All,
I am trying to compile the the delete_keys.erl and its failing as below.
I dont have much knowledge about Erlang.

%% -------------------------------------------------------------------

-module(reduce_functions).

-export([delete/2]).

% Data is a list of bucket and key pairs, intermixed with the counts of deleted
% objects. Returns a count of deleted objects.
delete(List, _None) ->
{ok, C} = riak:local_client(),

Delete = fun(Bucket, Key) ->
case C:delete(Bucket, Key, 0) of
ok -> 1;
_ -> 0
end
end,

F = fun(Elem, Acc) ->
case Elem of
{{Bucket, Key}, _KeyData} ->
Acc + Delete(Bucket, Key);
{Bucket, Key} ->
Acc + Delete(Bucket, Key);
[Bucket, Key] ->
Acc + Delete(Bucket, Key);
_ ->
Acc + Elem
end
end,

[lists:foldl(F, 0, List)]

electic@riak-1:~/modules$ /usr/lib/riak/erts-5.9.1/bin/erlc delete_keys.erl
delete_keys.erl:50: syntax error before:
delete_keys.erl:23: function delete/2 undefined

Am I missing something?
Thanks,
Shrikar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.