Skip to content

Commit

Permalink
Add support for Erlang 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeiklejohn committed Feb 27, 2015
1 parent d6b8602 commit 4a36cfc
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ repl_leader_eqc_data/
tags
dialyzer_unhandled_warnings
dialyzer_warnings
.rebar/
9 changes: 8 additions & 1 deletion include/riak_repl.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@
-type(repl_np_pairs() :: [repl_np_pair()]).
-type(repl_node_sites() :: {node(), [{repl_sitename(), pid()}]}).
-type(ring() :: tuple()).
-type(repl_config() :: dict()|undefined).

-ifdef(namespaced_types).
-type riak_repl_dict() :: dict:dict().
-else.
-type riak_repl_dict() :: dict().
-endif.

-type(repl_config() :: riak_repl_dict()|undefined).
%% wire_version() is an atom that defines which wire format a binary
%% encoding of one of more riak objects is packaged into. For details of
%% the to_wire() and from_wire() operations, see riak_repl_util.erl.
Expand Down
Binary file modified rebar
Binary file not shown.
4 changes: 3 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
%%-*- mode: erlang -*-

{cover_enabled, true}.
{erl_opts, [debug_info, warnings_as_errors, {parse_transform, lager_transform}]}.
{erl_opts, [debug_info, warnings_as_errors,
{parse_transform, lager_transform},
{platform_define, "^[0-9]+", namespaced_types}]}.
{erl_first_files, ["src/gen_leader.erl"]}.
{xref_checks, []}.
{xref_queries, [{"(XC - UC) || (XU - X - B - cluster_info : Mod)", []}]}.
Expand Down
8 changes: 7 additions & 1 deletion src/bounded_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@
-include_lib("eunit/include/eunit.hrl").
-endif.

-ifdef(namespaced_types).
-type bounded_queue_queue() :: queue:queue().
-else.
-type bounded_queue_queue() :: queue().
-endif.

-record(bq, {
m=0 :: non_neg_integer(), %% maximum size of queue, in bytes.
s=0 :: non_neg_integer(), %% current size of queue, in bytes.
q=queue:new() :: queue(), %% underlying queue.
q=queue:new() :: bounded_queue_queue(), %% underlying queue.
d=0 :: non_neg_integer()} %% dropped item count
).

Expand Down
4 changes: 2 additions & 2 deletions src/riak_repl_ring.erl
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ ensure_config(Ring) ->
Ring
end.

-spec(get_repl_config/1 :: (ring()) -> dict()|undefined).
-spec(get_repl_config/1 :: (ring()) -> riak_repl_dict()|undefined).
%% @doc Get the replication config dictionary from Ring.
get_repl_config(Ring) ->
case riak_core_ring:get_meta(?MODULE, Ring) of
{ok, RC} -> RC;
undefined -> initial_config()
end.

-spec(set_repl_config/2 :: (ring(), dict()) -> ring()).
-spec(set_repl_config/2 :: (ring(), riak_repl_dict()) -> ring()).
%% @doc Set the replication config dictionary in Ring.
set_repl_config(Ring, RC) ->
riak_core_ring:update_meta(?MODULE, RC, Ring).
Expand Down

10 comments on commit 4a36cfc

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from andrewjstone
at 4a36cfc

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_repl/17 = 4a36cfc into borshop-integration-659-17

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_repl/17 = 4a36cfc merged ok, testing candidate = ab0c764

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmeiklejohn
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop: retry

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from andrewjstone
at 4a36cfc

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_repl/17 = 4a36cfc into borshop-integration-659-17

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_repl/17 = 4a36cfc merged ok, testing candidate = 0489c7c

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding develop to borshop-integration-659-17 = 0489c7c

Please sign in to comment.