All Projects → lpgauth → swirl

lpgauth / swirl

Licence: MIT license
High-Performance Erlang Stream Processor

Programming Languages

erlang
1774 projects
Makefile
30231 projects

Projects that are alternatives of or similar to swirl

cpython
Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim
Stars: ✭ 75 (+44.23%)
Mutual labels:  high-performance
BeLibnids
It is a platform to use multiprocess to combine dpdk and libnids together to support analyse packets in 10G port.
Stars: ✭ 36 (-30.77%)
Mutual labels:  high-performance
storm-ml
an online learning algorithm library for Storm
Stars: ✭ 18 (-65.38%)
Mutual labels:  stream-processing
awesome-bigdata
A curated list of awesome big data frameworks, ressources and other awesomeness.
Stars: ✭ 11,093 (+21232.69%)
Mutual labels:  stream-processing
thread-pool
A modern thread pool implementation based on C++20
Stars: ✭ 104 (+100%)
Mutual labels:  high-performance
godsend
A simple and eloquent workflow for streaming messages to micro-services.
Stars: ✭ 15 (-71.15%)
Mutual labels:  stream-processing
quickstep
Quickstep project
Stars: ✭ 22 (-57.69%)
Mutual labels:  high-performance
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (+5.77%)
Mutual labels:  high-performance
gblastn
G-BLASTN is a GPU-accelerated nucleotide alignment tool based on the widely used NCBI-BLAST.
Stars: ✭ 52 (+0%)
Mutual labels:  high-performance
FoldsCUDA.jl
Data-parallelism on CUDA using Transducers.jl and for loops (FLoops.jl)
Stars: ✭ 48 (-7.69%)
Mutual labels:  high-performance
today-web
😐 A Java library for building web applications
Stars: ✭ 33 (-36.54%)
Mutual labels:  high-performance
talaria
TalariaDB is a distributed, highly available, and low latency time-series database for Presto
Stars: ✭ 148 (+184.62%)
Mutual labels:  stream-processing
artml
ARTML- Real time learning
Stars: ✭ 20 (-61.54%)
Mutual labels:  stream-processing
gostream
Stream Processing Library for Go
Stars: ✭ 51 (-1.92%)
Mutual labels:  stream-processing
EsperIoT
Small and simple stream-based CEP tool for IoT devices connected to an MQTT broker
Stars: ✭ 18 (-65.38%)
Mutual labels:  stream-processing
visual-heatmap
Open source javascript module for high performance, large scale heatmap rendering.
Stars: ✭ 21 (-59.62%)
Mutual labels:  high-performance
agroal
The natural database connection pool
Stars: ✭ 92 (+76.92%)
Mutual labels:  high-performance
streamdb-readings
Readings in Stream Processing
Stars: ✭ 62 (+19.23%)
Mutual labels:  stream-processing
stream-registry
Stream Discovery and Stream Orchestration
Stars: ✭ 105 (+101.92%)
Mutual labels:  stream-processing
mage
MAGE - Memgraph Advanced Graph Extensions 🔮
Stars: ✭ 89 (+71.15%)
Mutual labels:  stream-processing

swirl

High Performance Erlang Stream Processor

Build Status

Requirements

  • Erlang 16.0 +

Environment variables

Name Type Default Description
mappers_max pos_integer() 100 maximum number of mappers
reducers_max pos_integer() 100 maximum number of reducers

Examples

Starting a flow

ok = application:start(swirl),

FlowMod = swirl_flow_example,
FlowOpts = [
    {stream_names, [delivery]},
    {stream_filter, "exchange_id = 3 AND bidder_id IS NOT NULL"}
],
MapperNodes = [node()],
ReducerNode = node(),
{ok, Flow} = swirl_flow:start(FlowMod, FlowOpts, MapperNodes, ReducerNode),

StreamName = delivery,
Event = #{exchange_id => 1, bidder_id => 10},

swirl_stream:emit(StreamName, Event),

ok = swirl_flow:stop(Flow)

Implementing a flow

-module(swirl_flow_example).
-include_lib("swirl/include/swirl.hrl").

-behavior(swirl_flow).
-export([
    map/3,
    reduce/3,
    output/4
]).

%% swirl_flow callbacks
map(StreamName, Event, _MapperOpts) ->
    Type = ?L(type, Event),
    ExchangeId = ?L(exchange_id, Event),
    BidderId = ?L(bidder_id, Event),

    Key = {Type, StreamName, ExchangeId, BidderId},
    CounterIncrements = {1, 10},

    {Key, CounterIncrements}.

reduce(_Flow, Row, _ReducerOpts) ->
    Row.

output(_Flow, _Period, Rows, OutputOpts) ->
    %% do something with the output
    io:format("rows: ~p~n", [Rows]),

Stream Filter

exchange_id = 3 AND bidder_id IS NOT NULL
flight_id in (10, 12, 23) OR tag_id = 20
buyer_id notnull AND seller_id > 103

Swirl QL

variables:

atom()

values:

integer() | float() | binary()

boolean operators:

'and' | 'or'

comparison operators:

'<' | '<=' | '=' | '>=' | '>' | '<>'

inclusion operators:

in | notin

null operators:

null | notnull

TODO

  • node discovery
  • boolean expression indexing

Tests

make dialyzer
make elvis
make eunit
make xref

License

The MIT License (MIT)

Copyright (c) 2013-2016 Louis-Philippe Gauthier

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].