Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_build
*.beam
*.eqc
.eunit/*
Expand Down
39 changes: 0 additions & 39 deletions Makefile

This file was deleted.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
riak_ensemble_ng
-------------------

This repo and the corresponding hex package differ from the `basho/riak_ensemble` in the following ways:

* Removed use of `riak_ensemble_clock` replacing with OTP-18 time functionality
* `eleveldb` is no longer the default `synctree`

To use `eleveldb` as the `synctree` add the `eleveldb` dep to your projects `rebar.config` `dep` list. Add `eleveldb` to your app's `application` list *before* the entry for `riak_ensemble`. And add to your configuration `{riak_ensemble, [{synctree_backend, synctree_leveldb}]}`.

Original README
---------------

(Note: Work-in-progress documentation [here](https://github.com/basho/riak_ensemble/blob/develop/doc/Readme.md))

`riak_ensemble` is a consensus library that supports creating multiple
Expand Down
184 changes: 0 additions & 184 deletions c_src/riak_ensemble_clock.c

This file was deleted.

Binary file removed rebar
Binary file not shown.
18 changes: 8 additions & 10 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{deps, [{gen_fsm_compat, "~>0.3.0"}, {lager, "~>3.6.0"}]}.

{erl_opts, [debug_info,
warnings_as_errors,
warn_untyped_record,
{platform_define, "^[0-9]+", namespaced_types},
{parse_transform, lager_transform}]}.

{eunit_opts, [verbose]}.
{edoc_opts, [preprocess,
{dir, "edoc"}]}.
{cover_enabled, true}.
{xref_checks, [undefined_function_calls]}.
{deps, [
{lager, ".*", {git, "git://github.com/basho/lager.git", {tag, "3.2.2"}}},
{eleveldb, ".*", {git, "git://github.com/basho/eleveldb.git", {tag, "2.0.32"}}}
]}.

{port_specs,
[{".*", "priv/riak_ensemble.so",
["c_src/*.c*"],
[{env, [{"CFLAGS", "$CFLAGS"}]}]
}]}.
{profiles, [{test, [{deps, [{riak_test, ".*", {git, "git://github.com/basho/riak_test", {branch, "develop"}}}]}]}]}.

{plugins, [{rebar_erl_vsn, "~>0.2.0"}]}.
{provider_hooks, [{pre, [{compile, erl_vsn}]}]}.

10 changes: 10 additions & 0 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{"1.1.0",
[{<<"gen_fsm_compat">>,{pkg,<<"gen_fsm_compat">>,<<"0.3.0">>},0},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
{<<"lager">>,{pkg,<<"lager">>,<<"3.6.3">>},0}]}.
[
{pkg_hash,[
{<<"gen_fsm_compat">>, <<"5903549F67D595F58A7101154CBE0FDD46955FBFBE40813F1E53C23A970FF5F4">>},
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
{<<"lager">>, <<"FE78951D174616273F87F0DBC3374D1430B1952E5EFC4E1C995592D30A207294">>}]}
].
Binary file removed rebar.real
Binary file not shown.
11 changes: 0 additions & 11 deletions rebar.test.config

This file was deleted.

23 changes: 11 additions & 12 deletions src/riak_ensemble.app.src
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{application, riak_ensemble,
[
{description, ""},
{vsn, git},
{registered, []},
{applications, [
kernel,
stdlib
]},
{mod, { riak_ensemble_app, []}},
{env, []}
]}.
{application,riak_ensemble,
[{description,"Multi-Paxos framework in Erlang"},
{vsn,"2.4.4"},
{registered,[]},
{applications,[kernel,stdlib,lager,gen_fsm_compat]},
{mod,{riak_ensemble_app,[]}},
{env,[]},
{maintainers,["basho","Tristan Sloughter"]},
{pkg_name,riak_ensemble_ng},
{licenses,["Apache 2.0"]},
{links,[{"Github","https://github.com/basho/riak_ensemble"}]}]}.
20 changes: 3 additions & 17 deletions src/riak_ensemble_clock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,11 @@
%%
%% -------------------------------------------------------------------
-module(riak_ensemble_clock).
-on_load(init/0).

-export([monotonic_time/0, monotonic_time_ms/0]).

monotonic_time() ->
erlang:nif_error({error, not_loaded}).
{ok, erlang:monotonic_time()}.

monotonic_time_ms() ->
erlang:nif_error({error, not_loaded}).

init() ->
case code:priv_dir(riak_ensemble) of
{error, bad_name} ->
case code:which(?MODULE) of
Filename when is_list(Filename) ->
SoName = filename:join([filename:dirname(Filename),"../priv", "riak_ensemble"]);
_ ->
SoName = filename:join("../priv", "riak_ensemble")
end;
Dir ->
SoName = filename:join(Dir, "riak_ensemble")
end,
erlang:load_nif(SoName, 0).
{ok, erlang:monotonic_time(milli_seconds)}.
10 changes: 8 additions & 2 deletions src/riak_ensemble_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@
%%
%% -------------------------------------------------------------------
-module(riak_ensemble_config).
-compile(export_all).
-include_lib("riak_ensemble_types.hrl").

-export([tick/0, lease/0, trust_lease/0, follower_timeout/0,
election_timeout/0, prefollow_timeout/0, pending_timeout/0,
probe_delay/0, local_get_timeout/0, local_put_timeout/0,
alive_ticks/0, peer_workers/0, storage_delay/0, storage_tick/0,
tree_validation/0, synchronous_tree_updates/0,
notfound_read_delay/0, get_env/2]).

%% @doc
%% The primary ensemble tick that determines the rate at which an elected
%% leader attempts to refresh its lease.
Expand Down Expand Up @@ -51,7 +57,7 @@ follower_timeout() ->
%% The election timeout used for randomized election.
election_timeout() ->
Timeout = follower_timeout(),
Timeout + random:uniform(Timeout).
Timeout + riak_ensemble_util:random_uniform(Timeout).

%% @doc
%% The prefollow timeout determines how long a peer waits to hear from the
Expand Down
Loading