Skip to content

Commit

Permalink
Merging in changes proposed in:
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbailey4 committed Jul 22, 2016
1 parent 499d013 commit 42cc60b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{deps, [
{lager, "(2.0|2.1|2.2).*", {git, "git://github.com/basho/lager.git", {tag, "2.2.3"}}},
{eleveldb, ".*", {git, "git://github.com/basho/eleveldb.git", {branch, "2.2"}}}
{time_compat, ".*", {git, "git://github.com/lasp-lang/time_compat.git", {branch, "master"}}}
]}.

{port_specs,
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 @@ -487,7 +487,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

0 comments on commit 42cc60b

Please sign in to comment.