Remove unused prev_epoch_num and prev_epoch_csum

This commit is contained in:
Scott Lystig Fritchie 2014-10-31 17:25:27 +09:00
parent 9af576d753
commit 8faa1404c6
4 changed files with 6 additions and 21 deletions

View file

@ -35,8 +35,6 @@
-record(projection, {
epoch_number :: m_epoch_n(),
epoch_csum :: m_csum(),
prev_epoch_num :: m_epoch_n(),
prev_epoch_csum :: m_csum(),
all_members :: [m_server()],
down :: [m_server()],
creation_time :: timestamp(),

View file

@ -47,12 +47,10 @@ make_initial_projection(MyName, All_list, UPI_list, Repairing_list, Ps) ->
make_projection(1, 0, <<>>,
MyName, All_list, [], UPI_list, Repairing_list, Ps).
make_projection(EpochNum, PrevEpochNum, PrevEpochCSum,
make_projection(EpochNum, _PrevEpochNum, _PrevEpochCSum,
MyName, All_list, Down_list, UPI_list, Repairing_list, Ps) ->
P = #projection{epoch_number=EpochNum,
epoch_csum= <<>>,
prev_epoch_num=PrevEpochNum,
prev_epoch_csum=PrevEpochCSum,
creation_time=now(),
author_server=MyName,
all_members=All_list,

View file

@ -320,23 +320,20 @@ do_read_repair(FLUsRs, _Extra, #ch_mgr{proj=CurrentProj} = S) ->
end.
make_initial_projection(MyName, All_list, UPI_list, Repairing_list, Ps) ->
make_projection(0, -1, <<>>,
MyName, All_list, [], UPI_list, Repairing_list, Ps).
make_projection(0, MyName, All_list, [], UPI_list, Repairing_list, Ps).
make_projection(EpochNum, PrevEpochNum, PrevEpochCSum,
make_projection(EpochNum,
MyName, All_list, Down_list, UPI_list, Repairing_list,
Dbg) ->
make_projection(EpochNum, PrevEpochNum, PrevEpochCSum,
make_projection(EpochNum,
MyName, All_list, Down_list, UPI_list, Repairing_list,
Dbg, []).
make_projection(EpochNum, PrevEpochNum, PrevEpochCSum,
make_projection(EpochNum,
MyName, All_list, Down_list, UPI_list, Repairing_list,
Dbg, Dbg2) ->
P = #projection{epoch_number=EpochNum,
epoch_csum= <<>>, % always checksums as <<>>
prev_epoch_num=PrevEpochNum,
prev_epoch_csum=PrevEpochCSum,
creation_time=now(),
author_server=MyName,
all_members=All_list,
@ -368,7 +365,6 @@ calc_projection(#ch_mgr{proj=LastProj, runenv=RunEnv} = S, Dbg) ->
calc_projection(OldThreshold, NoPartitionThreshold, LastProj, Dbg,
#ch_mgr{name=MyName, runenv=RunEnv1} = S) ->
#projection{epoch_number=OldEpochNum,
epoch_csum=OldEpochCsum,
all_members=All_list,
upi=OldUPI_list,
repairing=OldRepairing_list
@ -401,7 +397,7 @@ calc_projection(OldThreshold, NoPartitionThreshold, LastProj, Dbg,
NewUp -> Repairing_list3 ++ NewUp
end,
Repairing_list5 = Repairing_list4 -- Down,
P = make_projection(OldEpochNum + 1, OldEpochNum, OldEpochCsum,
P = make_projection(OldEpochNum + 1,
MyName, All_list, Down, NewUPI_list3, Repairing_list5,
Dbg ++ [{nodes_up, Up}]),
{P, S#ch_mgr{runenv=RunEnv3}}.

View file

@ -222,8 +222,6 @@ projection_transitions_are_sane([P1, P2|T]) ->
projection_transition_is_sane(
#projection{epoch_number=Epoch1,
epoch_csum=CSum1,
prev_epoch_num=PrevEpoch1,
prev_epoch_csum=PrevCSum1,
creation_time=CreationTime1,
author_server=AuthorServer1,
all_members=All_list1,
@ -233,8 +231,6 @@ projection_transition_is_sane(
dbg=Dbg1} = P1,
#projection{epoch_number=Epoch2,
epoch_csum=CSum2,
prev_epoch_num=PrevEpoch2,
prev_epoch_csum=PrevCSum2,
creation_time=CreationTime2,
author_server=AuthorServer2,
all_members=All_list2,
@ -245,8 +241,6 @@ projection_transition_is_sane(
try
true = is_integer(Epoch1) andalso is_integer(Epoch2),
true = is_binary(CSum1) andalso is_binary(CSum2),
true = is_integer(PrevEpoch1) andalso is_integer(PrevEpoch2),
true = is_binary(PrevCSum1) andalso is_binary(PrevCSum2),
{_,_,_} = CreationTime1,
{_,_,_} = CreationTime2,
true = is_atom(AuthorServer1) andalso is_atom(AuthorServer2), % todo will probably change
@ -257,7 +251,6 @@ projection_transition_is_sane(
true = is_list(Dbg1) andalso is_list(Dbg2),
true = Epoch2 > Epoch1,
true = PrevEpoch2 > PrevEpoch1,
All_list1 = All_list2, % todo will probably change
%% No duplicates