WIP: Type fixups

This commit is contained in:
Scott Lystig Fritchie 2015-04-09 21:32:04 +09:00
parent 1984c3c350
commit 4f7177067e
5 changed files with 16 additions and 15 deletions

View file

@ -29,13 +29,13 @@
flap_limit :: non_neg_integer(),
proj :: projection(),
%%
timer :: 'undefined' | reference(),
proj_history :: queue(),
timer :: 'undefined' | timer:tref(),
proj_history :: queue:queue(),
flaps=0 :: integer(),
flap_start = ?NOT_FLAPPING
:: erlang:now(),
:: erlang:timestamp(),
runenv :: list(), %proplist()
opts :: list(), %proplist()
members_dict :: p_srvr_dict(),
proxies_dict :: orddict:orddict(pv1_server(), pid())
proxies_dict :: orddict:orddict()
}).

View file

@ -36,7 +36,7 @@
}).
-type p_srvr() :: #p_srvr{}.
-type p_srvr_dict() :: orddict:orddict(pv1_server(), p_srvr()).
-type p_srvr_dict() :: orddict:orddict().
-define(DUMMY_PV1_EPOCH, {0,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>}).

View file

@ -192,8 +192,8 @@ handle_call({test_set_active, Boolean}, _From, #ch_mgr{timer=TRef}=S) ->
{true, undefined} ->
S2 = set_active_timer(S),
{reply, ok, S2};
{false, TRef} when is_reference(TRef) ->
timer:cancel(TRef),
{false, _} ->
(catch timer:cancel(TRef)),
{reply, ok, S#ch_mgr{timer=undefined}};
_ ->
{reply, error, S}

View file

@ -128,11 +128,11 @@ long_doc() ->
n of a naive/1st draft detection algorithm.
".
convergence_demo_test_() ->
{timeout, 98*300, fun() -> convergence_demo_testfun() end}.
%% convergence_demo_test_() ->
%% {timeout, 98*300, fun() -> convergence_demo_testfun() end}.
convergence_demo_testfun() ->
convergence_demo_testfun(3).
%% convergence_demo_testfun() ->
%% convergence_demo_testfun(3).
t() ->
t(3).
@ -355,7 +355,7 @@ convergence_demo_testfun(NumFLUs) ->
after
[ok = ?MGR:stop(MgrPid) || {_, MgrPid} <- MgrNamez],
[ok = ?FLU_PC:quit(PPid) || {_, PPid} <- Namez],
[ok = ?FLU_C:stop(FLUPid) || FLUPid <- FLU_pids],
[ok = machi_flu1:stop(FLUPid) || FLUPid <- FLU_pids],
ok = machi_partition_simulator:stop()
end.

View file

@ -48,12 +48,12 @@
unanimous_report(Namez) ->
UniquePrivateEs =
lists:usort(lists:flatten(
[machi_flu0:proj_list_all(FLU, private) ||
[element(2, ?FLU_PC:list_all_projections(FLU, private)) ||
{_FLUName, FLU} <- Namez])),
[unanimous_report(Epoch, Namez) || Epoch <- UniquePrivateEs].
unanimous_report(Epoch, Namez) ->
Projs = [{FLUName, case machi_flu0:proj_read(FLU, Epoch, private) of
Projs = [{FLUName, case ?FLU_PC:read_projection(FLU, private, Epoch) of
{ok, T} -> T;
_Else -> not_in_this_epoch
end} || {FLUName, FLU} <- Namez],
@ -128,7 +128,8 @@ extract_chains_relative_to_flu(FLU, Report) ->
lists:member(FLU, UPI) orelse lists:member(FLU, Repairing)]}.
chain_to_projection(MyName, Epoch, UPI_list, Repairing_list, All_list) ->
?MGR:make_projection(Epoch, MyName, All_list,
exit({todo_broken_fixme,?MODULE,?LINE}),
machi_projection:new(Epoch, MyName, All_list,
All_list -- (UPI_list ++ Repairing_list),
UPI_list, Repairing_list, []).