Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/linkdd/emapred

Erlang Map-Reduce framework
https://github.com/linkdd/emapred

distributed erlang mapreduce

Last synced: 19 days ago
JSON representation

Erlang Map-Reduce framework

Awesome Lists containing this project

README

        

emapred
=======

Erlang distributed Map-Reduce framework.

.. image:: https://travis-ci.org/linkdd/emapred.svg?branch=master
:target: https://travis-ci.org/linkdd/emapred

Features
--------

- run arbitrary Map/Reduce functions on a list
- automatically distribute workload across nodes running this application

Example
-------

.. code-block:: erlang

{ok, P} = emapred_pipeline:new(
% Mapper
fun(E) ->
case E > 5 of
true -> {emit, {foo, 1}};
false -> {emit, {foo, -1}}
end
end,
% Reducer
fun(_Key, Increment, Counter) ->
{ok, Counter + Increment}
end,
% Initial value for reducer accumulator
0
),
% Stream elements to map
ok = emapred_pipeline:send(P, 5),
ok = emapred_pipeline:send(P, 6),
ok = emapred_pipeline:send(P, 3),
ok = emapred_pipeline:send(P, 4),
ok = emapred_pipeline:send(P, 7),
% Stop streaming and get reduced result
-1 = emapred_pipeline:stop(P).

Build
-----

.. code-block:: console

$ rebar3 compile