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
5 changes: 3 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
{dir, "edoc"}]}.
{cover_enabled, true}.
{xref_checks, [undefined_function_calls]}.
{deps, [{lager, "2.0.3", {git, "git://github.com/basho/lager.git", {tag, "2.0.3"}}},
{eleveldb, ".*", {git, "git://github.com/basho/eleveldb.git", {tag, "2.1.0"}}}]}.
{deps, [{lager, "(2.1|2.2).*", {git, "git://github.com/basho/lager.git", {tag, "2.2.0"}}},
{eleveldb, ".*", {git, "git://github.com/basho/eleveldb.git", {tag, "2.1.0"}}},
{time_compat, ".*", {git, "git://github.com/lasp-lang/time_compat.git", {branch, "master"}}}]}.

{port_specs,
[{".*", "priv/riak_ensemble.so",
Expand Down
2 changes: 1 addition & 1 deletion src/riak_ensemble_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ reload_state() ->
-spec initial_state() -> state().
initial_state() ->
ets:insert(?ETS, {enabled, false}),
ClusterName = {node(), erlang:now()},
ClusterName = {node(), time_compat:timestamp()},
CS = riak_ensemble_state:new(ClusterName),
State=#state{version=0,
ensemble_data=[],
Expand Down
5 changes: 1 addition & 4 deletions src/synctree_leveldb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ get_path(Opts) ->
case proplists:get_value(path, Opts) of
undefined ->
Base = "/tmp/ST",
Name = integer_to_list(timestamp(erlang:now())),
Name = integer_to_list(time_compat:unique_integer([positive])),
filename:join(Base, Name);
Path ->
Path
Expand Down Expand Up @@ -151,9 +151,6 @@ store(Updates, State=?STATE{id=Id, db=DB}) ->
_ = eleveldb:write(DB, DBUpdates, []),
State.

timestamp({Mega, Secs, Micro}) ->
Mega*1000*1000*1000*1000 + Secs * 1000 * 1000 + Micro.

leveldb_opts() ->
[{is_internal_db, true},
{write_buffer_size, 4 * 1024 * 1024},
Expand Down