@@ -281,8 +281,7 @@ wait_for_leader(_Timeout, 0) ->
281281wait_for_leader (Timeout , Retries ) ->
282282 rabbit_log :info (" Waiting for Khepri leader for ~tp ms, ~tp retries left" ,
283283 [Timeout , Retries - 1 ]),
284- Options = #{timeout => Timeout ,
285- favor => low_latency },
284+ Options = #{timeout => Timeout },
286285 case khepri :exists (? STORE_ID , [], Options ) of
287286 Exists when is_boolean (Exists ) ->
288287 rabbit_log :info (" Khepri leader elected" ),
@@ -866,50 +865,46 @@ cas(Path, Pattern, Data) ->
866865 ? STORE_ID , Path , Pattern , Data , ? DEFAULT_COMMAND_OPTIONS ).
867866
868867fold (Path , Pred , Acc ) ->
869- khepri :fold (? STORE_ID , Path , Pred , Acc , #{ favor => low_latency } ).
868+ khepri :fold (? STORE_ID , Path , Pred , Acc ).
870869
871870fold (Path , Pred , Acc , Options ) ->
872- Options1 = Options #{favor => low_latency },
873- khepri :fold (? STORE_ID , Path , Pred , Acc , Options1 ).
871+ khepri :fold (? STORE_ID , Path , Pred , Acc , Options ).
874872
875873foreach (Path , Pred ) ->
876- khepri :foreach (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
874+ khepri :foreach (? STORE_ID , Path , Pred ).
877875
878876filter (Path , Pred ) ->
879- khepri :filter (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
877+ khepri :filter (? STORE_ID , Path , Pred ).
880878
881879get (Path ) ->
882- khepri :get (? STORE_ID , Path , #{ favor => low_latency } ).
880+ khepri :get (? STORE_ID , Path ).
883881
884882get (Path , Options ) ->
885- Options1 = Options #{favor => low_latency },
886- khepri :get (? STORE_ID , Path , Options1 ).
883+ khepri :get (? STORE_ID , Path , Options ).
887884
888885get_many (PathPattern ) ->
889- khepri :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
886+ khepri :get_many (? STORE_ID , PathPattern ).
890887
891888adv_get (Path ) ->
892- khepri_adv :get (? STORE_ID , Path , #{ favor => low_latency } ).
889+ khepri_adv :get (? STORE_ID , Path ).
893890
894891adv_get_many (PathPattern ) ->
895- khepri_adv :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
892+ khepri_adv :get_many (? STORE_ID , PathPattern ).
896893
897894match (Path ) ->
898895 match (Path , #{}).
899896
900897match (Path , Options ) ->
901- Options1 = Options #{favor => low_latency },
902- khepri :get_many (? STORE_ID , Path , Options1 ).
898+ khepri :get_many (? STORE_ID , Path , Options ).
903899
904- exists (Path ) -> khepri :exists (? STORE_ID , Path , #{ favor => low_latency } ).
900+ exists (Path ) -> khepri :exists (? STORE_ID , Path ).
905901
906902list (Path ) ->
907903 khepri :get_many (
908- ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ], #{ favor => low_latency } ).
904+ ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ]).
909905
910906list_child_nodes (Path ) ->
911- Options = #{props_to_return => [child_names ],
912- favor => low_latency },
907+ Options = #{props_to_return => [child_names ]},
913908 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
914909 {ok , Result } ->
915910 case maps :values (Result ) of
@@ -923,8 +918,7 @@ list_child_nodes(Path) ->
923918 end .
924919
925920count_children (Path ) ->
926- Options = #{props_to_return => [child_list_length ],
927- favor => low_latency },
921+ Options = #{props_to_return => [child_list_length ]},
928922 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
929923 {ok , Map } ->
930924 lists :sum ([L || #{child_list_length := L } <- maps :values (Map )]);
@@ -975,18 +969,9 @@ transaction(Fun) ->
975969transaction (Fun , ReadWrite ) ->
976970 transaction (Fun , ReadWrite , #{}).
977971
978- transaction (Fun , ReadWrite , Options0 ) ->
979- % % If the transaction is read-only, use the same default options we use
980- % % for most queries.
981- DefaultQueryOptions = case ReadWrite of
982- ro ->
983- #{favor => low_latency };
984- _ ->
985- #{}
986- end ,
987- Options1 = maps :merge (DefaultQueryOptions , Options0 ),
988- Options = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options1 ),
989- case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options ) of
972+ transaction (Fun , ReadWrite , Options ) ->
973+ Options1 = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options ),
974+ case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options1 ) of
990975 ok -> ok ;
991976 {ok , Result } -> Result ;
992977 {error , Reason } -> throw ({error , Reason })
0 commit comments