Skip to content

Commit

Permalink
Merge pull request #2 from lpgauth/dev
Browse files Browse the repository at this point in the history
0.1.0
  • Loading branch information
lpgauth committed Apr 1, 2015
2 parents 36f1b3e + 645941b commit 7bc747f
Show file tree
Hide file tree
Showing 36 changed files with 3,273 additions and 9 deletions.
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
.eunit
deps
*.o
*.beam
*.o
*.plt
erl_crash.dump
ebin
rel/example_project
.concrete/DEV_MODE
.eunit
.rebar
deps/
doc/README.md
ebin/
erl_crash.dump
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
PROJECT=marina
REBAR=./rebar

all: deps compile

build-plt: all
@dialyzer --build_plt --output_plt ~/.$(PROJECT).plt \
--apps erts kernel stdlib crypto public_key ssl

check-plt:
@dialyzer --check_plt --plt ~/.$(PROJECT).plt

clean:
@echo "Running rebar clean..."
@$(REBAR) clean
@rm -rf deps ebin

compile:
@echo "Running rebar compile..."
@$(REBAR) compile

deps:
@echo "Running rebar update-deps..."
@$(REBAR) update-deps

dialyze:
@dialyzer ebin/*.beam --plt ~/.$(PROJECT).plt -I include

doc:
@echo "Running rebar doc..."
@$(REBAR) skip_deps=true doc

eunit:
@echo "Running rebar eunit..."
@$(REBAR) skip_deps=true eunit

test: all eunit

.PHONY: deps doc test
59 changes: 57 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# marina
Non-blocking cassandra CQL3 client (erlang)


# marina #

__Authors:__ Louis-Philippe Gauthier.

Non-blocking Erlang Cassandra CQL3 client


## Features ##

* Async mode
* Backpressure via backlog (OOM protection)
* Binary protocol V3
* CQL protocol 3.2.0
* Performance optimized
* Prepared statement cache
* Request pipelining



## Environment variables ##

* ip : server ip
* port : server port
* keyspace : default keyspace
* pool_size : number of connections
* max_backlog_size: maximum number of concurrent requests per connection



## TODO ##
* compression
* documentation
* tests




## Modules ##


<table width="100%" border="0" summary="list of modules">
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina.md" class="module">marina</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_app.md" class="module">marina_app</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_backlog.md" class="module">marina_backlog</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_body.md" class="module">marina_body</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_buffer.md" class="module">marina_buffer</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_cache.md" class="module">marina_cache</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_frame.md" class="module">marina_frame</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_queue.md" class="module">marina_queue</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_request.md" class="module">marina_request</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_server.md" class="module">marina_server</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_sup.md" class="module">marina_sup</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_types.md" class="module">marina_types</a></td></tr>
<tr><td><a href="http://github.com/lpgauth/marina/blob/dev/doc/marina_utils.md" class="module">marina_utils</a></td></tr></table>

6 changes: 6 additions & 0 deletions doc/edoc-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
%% encoding: UTF-8
{application,marina}.
{packages,[]}.
{modules,[marina,marina_app,marina_backlog,marina_body,marina_buffer,
marina_cache,marina_frame,marina_queue,marina_request,marina_server,
marina_sup,marina_types,marina_utils]}.
184 changes: 184 additions & 0 deletions doc/marina.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@


# Module marina #
* [Data Types](#types)
* [Function Index](#index)
* [Function Details](#functions)



<a name="types"></a>

## Data Types ##




### <a name="type-consistency">consistency()</a> ###



<pre><code>
consistency() = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16
</code></pre>





### <a name="type-flags">flags()</a> ###



<pre><code>
flags() = 0..254
</code></pre>





### <a name="type-query">query()</a> ###



<pre><code>
query() = binary()
</code></pre>





### <a name="type-statement_id">statement_id()</a> ###



<pre><code>
statement_id() = binary()
</code></pre>





### <a name="type-value">value()</a> ###



<pre><code>
value() = binary()
</code></pre>


<a name="index"></a>

## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#async_execute-5">async_execute/5</a></td><td></td></tr><tr><td valign="top"><a href="#async_prepare-2">async_prepare/2</a></td><td></td></tr><tr><td valign="top"><a href="#async_query-4">async_query/4</a></td><td></td></tr><tr><td valign="top"><a href="#async_reusable_query-6">async_reusable_query/6</a></td><td></td></tr><tr><td valign="top"><a href="#execute-5">execute/5</a></td><td></td></tr><tr><td valign="top"><a href="#prepare-2">prepare/2</a></td><td></td></tr><tr><td valign="top"><a href="#query-4">query/4</a></td><td></td></tr><tr><td valign="top"><a href="#response-1">response/1</a></td><td></td></tr><tr><td valign="top"><a href="#reusable_query-5">reusable_query/5</a></td><td></td></tr></table>


<a name="functions"></a>

## Function Details ##

<a name="async_execute-5"></a>

### async_execute/5 ###


<pre><code>
async_execute(StatementId::<a href="#type-statement_id">statement_id()</a>, Values::[<a href="#type-value">value()</a>], ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Pid::pid()) -&gt; {ok, <a href="erlang.md#type-ref">erlang:ref()</a>} | {error, backlog_full}
</code></pre>
<br />


<a name="async_prepare-2"></a>

### async_prepare/2 ###


<pre><code>
async_prepare(Query::<a href="#type-query">query()</a>, Pid::pid()) -&gt; {ok, <a href="erlang.md#type-ref">erlang:ref()</a>} | {error, backlog_full}
</code></pre>
<br />


<a name="async_query-4"></a>

### async_query/4 ###


<pre><code>
async_query(Query::<a href="#type-query">query()</a>, ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Pid::pid()) -&gt; {ok, <a href="erlang.md#type-ref">erlang:ref()</a>} | {error, backlog_full}
</code></pre>
<br />


<a name="async_reusable_query-6"></a>

### async_reusable_query/6 ###


<pre><code>
async_reusable_query(Query::<a href="#type-query">query()</a>, Values::[<a href="#type-value">value()</a>], ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Pid::pid(), Timeout::timeout()) -&gt; {ok, <a href="erlang.md#type-ref">erlang:ref()</a>} | {error, term()}
</code></pre>
<br />


<a name="execute-5"></a>

### execute/5 ###


<pre><code>
execute(StatementId::<a href="#type-statement_id">statement_id()</a>, Values::[<a href="#type-value">value()</a>], ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Timeout::timeout()) -&gt; {ok, term()} | {error, term()}
</code></pre>
<br />


<a name="prepare-2"></a>

### prepare/2 ###


<pre><code>
prepare(Query::<a href="#type-query">query()</a>, Timeout::timeout()) -&gt; {ok, term()} | {error, term()}
</code></pre>
<br />


<a name="query-4"></a>

### query/4 ###


<pre><code>
query(Query::<a href="#type-query">query()</a>, ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Timeout::timeout()) -&gt; {ok, term()} | {error, term()}
</code></pre>
<br />


<a name="response-1"></a>

### response/1 ###


<pre><code>
response(X1::{ok, term()} | {error, term()}) -&gt; {ok, term()} | {error, term()}
</code></pre>
<br />


<a name="reusable_query-5"></a>

### reusable_query/5 ###


<pre><code>
reusable_query(Query::<a href="#type-query">query()</a>, Values::[<a href="#type-value">value()</a>], ConsistencyLevel::<a href="#type-consistency">consistency()</a>, Flags::<a href="#type-flags">flags()</a>, Timeout::timeout()) -&gt; {ok, term()} | {error, term()}
</code></pre>
<br />


44 changes: 44 additions & 0 deletions doc/marina_app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@


# Module marina_app #
* [Function Index](#index)
* [Function Details](#functions)

__Behaviours:__ [`application`](application.md).
<a name="index"></a>

## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#start-0">start/0</a></td><td></td></tr><tr><td valign="top"><a href="#start-2">start/2</a></td><td></td></tr><tr><td valign="top"><a href="#stop-1">stop/1</a></td><td></td></tr></table>


<a name="functions"></a>

## Function Details ##

<a name="start-0"></a>

### start/0 ###


<pre><code>
start() -&gt; ok
</code></pre>
<br />


<a name="start-2"></a>

### start/2 ###

`start(StartType, StartArgs) -> any()`


<a name="stop-1"></a>

### stop/1 ###

`stop(State) -> any()`


Loading

0 comments on commit 7bc747f

Please sign in to comment.