Skip to content

Commit c031f04

Browse files
author
Loïc Hoguin
committed
Remove unused fields in client_msstate
1 parent 4f06544 commit c031f04

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

deps/rabbit/src/rabbit_msg_store.erl

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,10 @@
9696
-record(client_msstate,
9797
{ server,
9898
client_ref,
99-
file_handle_cache, %% Unused.
10099
index_state,
101100
index_module,
102101
dir,
103-
gc_pid, %% Value is set correctly but unused.
104102
file_handles_ets,
105-
file_summary_ets, %% Value is set correctly but unused.
106103
cur_file_cache_ets,
107104
flying_ets,
108105
credit_disc_bound
@@ -144,14 +141,11 @@
144141
-type client_msstate() :: #client_msstate {
145142
server :: server(),
146143
client_ref :: client_ref(),
147-
file_handle_cache :: map(),
148144
index_state :: any(),
149145
index_module :: atom(),
150146
%% Stored as binary() as opposed to file:filename() to save memory.
151147
dir :: binary(),
152-
gc_pid :: pid(),
153148
file_handles_ets :: ets:tid(),
154-
file_summary_ets :: ets:tid(),
155149
cur_file_cache_ets :: ets:tid(),
156150
flying_ets :: ets:tid(),
157151
credit_disc_bound :: {pos_integer(), pos_integer()}}.
@@ -409,22 +403,18 @@ successfully_recovered_state(Server) ->
409403
-spec client_init(server(), client_ref(), maybe_msg_id_fun()) -> client_msstate().
410404

411405
client_init(Server, Ref, MsgOnDiskFun) when is_pid(Server); is_atom(Server) ->
412-
{IState, IModule, Dir, GCPid,
413-
FileHandlesEts, FileSummaryEts, CurFileCacheEts, FlyingEts} =
406+
{IState, IModule, Dir, FileHandlesEts, CurFileCacheEts, FlyingEts} =
414407
gen_server2:call(
415408
Server, {new_client_state, Ref, self(), MsgOnDiskFun},
416409
infinity),
417410
CreditDiscBound = rabbit_misc:get_env(rabbit, msg_store_credit_disc_bound,
418411
?CREDIT_DISC_BOUND),
419412
#client_msstate { server = Server,
420413
client_ref = Ref,
421-
file_handle_cache = #{},
422414
index_state = IState,
423415
index_module = IModule,
424416
dir = rabbit_file:filename_to_binary(Dir),
425-
gc_pid = GCPid,
426417
file_handles_ets = FileHandlesEts,
427-
file_summary_ets = FileSummaryEts,
428418
cur_file_cache_ets = CurFileCacheEts,
429419
flying_ets = FlyingEts,
430420
credit_disc_bound = CreditDiscBound }.
@@ -806,14 +796,12 @@ handle_call({new_client_state, CRef, CPid, MsgOnDiskFun}, _From,
806796
index_state = IndexState,
807797
index_module = IndexModule,
808798
file_handles_ets = FileHandlesEts,
809-
file_summary_ets = FileSummaryEts,
810799
cur_file_cache_ets = CurFileCacheEts,
811800
flying_ets = FlyingEts,
812-
clients = Clients,
813-
gc_pid = GCPid }) ->
801+
clients = Clients }) ->
814802
Clients1 = maps:put(CRef, {CPid, MsgOnDiskFun}, Clients),
815803
erlang:monitor(process, CPid),
816-
reply({IndexState, IndexModule, Dir, GCPid, FileHandlesEts, FileSummaryEts,
804+
reply({IndexState, IndexModule, Dir, FileHandlesEts,
817805
CurFileCacheEts, FlyingEts},
818806
State #msstate { clients = Clients1 });
819807

0 commit comments

Comments
 (0)