@@ -129,10 +129,10 @@ handle_go(Q = #amqqueue{name = QName}) ->
129129 rate_timer_ref = undefined ,
130130 sync_timer_ref = undefined ,
131131
132- sender_queues = dict : new () ,
133- msg_id_ack = dict : new () ,
132+ sender_queues = #{} ,
133+ msg_id_ack = #{} ,
134134
135- msg_id_status = dict : new () ,
135+ msg_id_status = #{} ,
136136 known_senders = pmon :new (delegate ),
137137
138138 depth_delta = undefined
@@ -310,7 +310,7 @@ handle_cast({sync_start, Ref, Syncer},
310310 State1 = # state {rate_timer_ref = TRef } = ensure_rate_timer (State ),
311311 S = fun ({MA , TRefN , BQSN }) ->
312312 State1 # state {depth_delta = undefined ,
313- msg_id_ack = dict :from_list (MA ),
313+ msg_id_ack = maps :from_list (MA ),
314314 rate_timer_ref = TRefN ,
315315 backing_queue_state = BQSN }
316316 end ,
@@ -546,7 +546,7 @@ send_or_record_confirm(published, #delivery { sender = ChPid,
546546 id = MsgId ,
547547 is_persistent = true } },
548548 MS , # state { q = # amqqueue { durable = true } }) ->
549- dict : store (MsgId , {published , ChPid , MsgSeqNo } , MS );
549+ maps : put (MsgId , {published , ChPid , MsgSeqNo } , MS );
550550send_or_record_confirm (_Status , # delivery { sender = ChPid ,
551551 confirm = true ,
552552 msg_seq_no = MsgSeqNo },
@@ -559,20 +559,20 @@ confirm_messages(MsgIds, State = #state { msg_id_status = MS }) ->
559559 lists :foldl (
560560 fun (MsgId , {CMsN , MSN } = Acc ) ->
561561 % % We will never see 'discarded' here
562- case dict :find (MsgId , MSN ) of
562+ case maps :find (MsgId , MSN ) of
563563 error ->
564564 % % If it needed confirming, it'll have
565565 % % already been done.
566566 Acc ;
567567 {ok , published } ->
568568 % % Still not seen it from the channel, just
569569 % % record that it's been confirmed.
570- {CMsN , dict : store (MsgId , confirmed , MSN )};
570+ {CMsN , maps : put (MsgId , confirmed , MSN )};
571571 {ok , {published , ChPid , MsgSeqNo }} ->
572572 % % Seen from both GM and Channel. Can now
573573 % % confirm.
574574 {rabbit_misc :gb_trees_cons (ChPid , MsgSeqNo , CMsN ),
575- dict : erase (MsgId , MSN )};
575+ maps : remove (MsgId , MSN )};
576576 {ok , confirmed } ->
577577 % % It's already been confirmed. This is
578578 % % probably it's been both sync'd to disk
@@ -672,21 +672,21 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName },
672672 % % Master, or MTC in queue_process.
673673
674674 St = [published , confirmed , discarded ],
675- SS = dict :filter (fun (_MsgId , Status ) -> lists :member (Status , St ) end , MS ),
676- AckTags = [AckTag || {_MsgId , AckTag } <- dict :to_list (MA )],
675+ SS = maps :filter (fun (_MsgId , Status ) -> lists :member (Status , St ) end , MS ),
676+ AckTags = [AckTag || {_MsgId , AckTag } <- maps :to_list (MA )],
677677
678678 MasterState = rabbit_mirror_queue_master :promote_backing_queue_state (
679679 QName , CPid , BQ , BQS , GM , AckTags , SS , MPids ),
680680
681- MTC = dict :fold (fun (MsgId , {published , ChPid , MsgSeqNo }, MTC0 ) ->
681+ MTC = maps :fold (fun (MsgId , {published , ChPid , MsgSeqNo }, MTC0 ) ->
682682 gb_trees :insert (MsgId , {ChPid , MsgSeqNo }, MTC0 );
683683 (_Msgid , _Status , MTC0 ) ->
684684 MTC0
685685 end , gb_trees :empty (), MS ),
686686 Deliveries = [promote_delivery (Delivery ) ||
687- {_ChPid , {PubQ , _PendCh , _ChState }} <- dict :to_list (SQ ),
687+ {_ChPid , {PubQ , _PendCh , _ChState }} <- maps :to_list (SQ ),
688688 Delivery <- queue :to_list (PubQ )],
689- AwaitGmDown = [ChPid || {ChPid , {_ , _ , down_from_ch }} <- dict :to_list (SQ )],
689+ AwaitGmDown = [ChPid || {ChPid , {_ , _ , down_from_ch }} <- maps :to_list (SQ )],
690690 KS1 = lists :foldl (fun (ChPid0 , KS0 ) ->
691691 pmon :demonitor (ChPid0 , KS0 )
692692 end , KS , AwaitGmDown ),
@@ -798,20 +798,20 @@ forget_sender(Down1, Down2) when Down1 =/= Down2 -> true.
798798maybe_forget_sender (ChPid , ChState , State = # state { sender_queues = SQ ,
799799 msg_id_status = MS ,
800800 known_senders = KS }) ->
801- case dict :find (ChPid , SQ ) of
801+ case maps :find (ChPid , SQ ) of
802802 error ->
803803 State ;
804804 {ok , {MQ , PendCh , ChStateRecord }} ->
805805 case forget_sender (ChState , ChStateRecord ) of
806806 true ->
807807 credit_flow :peer_down (ChPid ),
808- State # state { sender_queues = dict : erase (ChPid , SQ ),
808+ State # state { sender_queues = maps : remove (ChPid , SQ ),
809809 msg_id_status = lists :foldl (
810- fun dict : erase /2 ,
810+ fun maps : remove /2 ,
811811 MS , sets :to_list (PendCh )),
812812 known_senders = pmon :demonitor (ChPid , KS ) };
813813 false ->
814- SQ1 = dict : store (ChPid , {MQ , PendCh , ChState }, SQ ),
814+ SQ1 = maps : put (ChPid , {MQ , PendCh , ChState }, SQ ),
815815 State # state { sender_queues = SQ1 }
816816 end
817817 end .
@@ -823,32 +823,32 @@ maybe_enqueue_message(
823823 send_mandatory (Delivery ), % % must do this before confirms
824824 State1 = ensure_monitoring (ChPid , State ),
825825 % % We will never see {published, ChPid, MsgSeqNo} here.
826- case dict :find (MsgId , MS ) of
826+ case maps :find (MsgId , MS ) of
827827 error ->
828828 {MQ , PendingCh , ChState } = get_sender_queue (ChPid , SQ ),
829829 MQ1 = queue :in (Delivery , MQ ),
830- SQ1 = dict : store (ChPid , {MQ1 , PendingCh , ChState }, SQ ),
830+ SQ1 = maps : put (ChPid , {MQ1 , PendingCh , ChState }, SQ ),
831831 State1 # state { sender_queues = SQ1 };
832832 {ok , Status } ->
833833 MS1 = send_or_record_confirm (
834- Status , Delivery , dict : erase (MsgId , MS ), State1 ),
834+ Status , Delivery , maps : remove (MsgId , MS ), State1 ),
835835 SQ1 = remove_from_pending_ch (MsgId , ChPid , SQ ),
836836 State1 # state { msg_id_status = MS1 ,
837837 sender_queues = SQ1 }
838838 end .
839839
840840get_sender_queue (ChPid , SQ ) ->
841- case dict :find (ChPid , SQ ) of
841+ case maps :find (ChPid , SQ ) of
842842 error -> {queue :new (), sets :new (), running };
843843 {ok , Val } -> Val
844844 end .
845845
846846remove_from_pending_ch (MsgId , ChPid , SQ ) ->
847- case dict :find (ChPid , SQ ) of
847+ case maps :find (ChPid , SQ ) of
848848 error ->
849849 SQ ;
850850 {ok , {MQ , PendingCh , ChState }} ->
851- dict : store (ChPid , {MQ , sets :del_element (MsgId , PendingCh ), ChState },
851+ maps : put (ChPid , {MQ , sets :del_element (MsgId , PendingCh ), ChState },
852852 SQ )
853853 end .
854854
@@ -865,7 +865,7 @@ publish_or_discard(Status, ChPid, MsgId,
865865 case queue :out (MQ ) of
866866 {empty , _MQ2 } ->
867867 {MQ , sets :add_element (MsgId , PendingCh ),
868- dict : store (MsgId , Status , MS )};
868+ maps : put (MsgId , Status , MS )};
869869 {{value , Delivery = # delivery {
870870 message = # basic_message { id = MsgId } }}, MQ2 } ->
871871 {MQ2 , PendingCh ,
@@ -880,7 +880,7 @@ publish_or_discard(Status, ChPid, MsgId,
880880 % % expecting any confirms from us.
881881 {MQ , PendingCh , MS }
882882 end ,
883- SQ1 = dict : store (ChPid , {MQ1 , PendingCh1 , ChState }, SQ ),
883+ SQ1 = maps : put (ChPid , {MQ1 , PendingCh1 , ChState }, SQ ),
884884 State1 # state { sender_queues = SQ1 , msg_id_status = MS1 }.
885885
886886
@@ -1002,17 +1002,17 @@ msg_ids_to_acktags(MsgIds, MA) ->
10021002 {AckTags , MA1 } =
10031003 lists :foldl (
10041004 fun (MsgId , {Acc , MAN }) ->
1005- case dict :find (MsgId , MA ) of
1005+ case maps :find (MsgId , MA ) of
10061006 error -> {Acc , MAN };
1007- {ok , AckTag } -> {[AckTag | Acc ], dict : erase (MsgId , MAN )}
1007+ {ok , AckTag } -> {[AckTag | Acc ], maps : remove (MsgId , MAN )}
10081008 end
10091009 end , {[], MA }, MsgIds ),
10101010 {lists :reverse (AckTags ), MA1 }.
10111011
10121012maybe_store_ack (false , _MsgId , _AckTag , State ) ->
10131013 State ;
10141014maybe_store_ack (true , MsgId , AckTag , State = # state { msg_id_ack = MA }) ->
1015- State # state { msg_id_ack = dict : store (MsgId , AckTag , MA ) }.
1015+ State # state { msg_id_ack = maps : put (MsgId , AckTag , MA ) }.
10161016
10171017set_delta (0 , State = # state { depth_delta = undefined }) ->
10181018 ok = record_synchronised (State # state .q ),
0 commit comments