@@ -292,8 +292,7 @@ wait_for_leader(_Timeout, 0) ->
292292wait_for_leader (Timeout , Retries ) ->
293293 rabbit_log :info (" Waiting for Khepri leader for ~tp ms, ~tp retries left" ,
294294 [Timeout , Retries - 1 ]),
295- Options = #{timeout => Timeout ,
296- favor => low_latency },
295+ Options = #{timeout => Timeout },
297296 case khepri :exists (? STORE_ID , [], Options ) of
298297 Exists when is_boolean (Exists ) ->
299298 rabbit_log :info (" Khepri leader elected" ),
@@ -877,50 +876,46 @@ cas(Path, Pattern, Data) ->
877876 ? STORE_ID , Path , Pattern , Data , ? DEFAULT_COMMAND_OPTIONS ).
878877
879878fold (Path , Pred , Acc ) ->
880- khepri :fold (? STORE_ID , Path , Pred , Acc , #{ favor => low_latency } ).
879+ khepri :fold (? STORE_ID , Path , Pred , Acc ).
881880
882881fold (Path , Pred , Acc , Options ) ->
883- Options1 = Options #{favor => low_latency },
884- khepri :fold (? STORE_ID , Path , Pred , Acc , Options1 ).
882+ khepri :fold (? STORE_ID , Path , Pred , Acc , Options ).
885883
886884foreach (Path , Pred ) ->
887- khepri :foreach (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
885+ khepri :foreach (? STORE_ID , Path , Pred ).
888886
889887filter (Path , Pred ) ->
890- khepri :filter (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
888+ khepri :filter (? STORE_ID , Path , Pred ).
891889
892890get (Path ) ->
893- khepri :get (? STORE_ID , Path , #{ favor => low_latency } ).
891+ khepri :get (? STORE_ID , Path ).
894892
895893get (Path , Options ) ->
896- Options1 = Options #{favor => low_latency },
897- khepri :get (? STORE_ID , Path , Options1 ).
894+ khepri :get (? STORE_ID , Path , Options ).
898895
899896get_many (PathPattern ) ->
900- khepri :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
897+ khepri :get_many (? STORE_ID , PathPattern ).
901898
902899adv_get (Path ) ->
903- khepri_adv :get (? STORE_ID , Path , #{ favor => low_latency } ).
900+ khepri_adv :get (? STORE_ID , Path ).
904901
905902adv_get_many (PathPattern ) ->
906- khepri_adv :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
903+ khepri_adv :get_many (? STORE_ID , PathPattern ).
907904
908905match (Path ) ->
909906 match (Path , #{}).
910907
911908match (Path , Options ) ->
912- Options1 = Options #{favor => low_latency },
913- khepri :get_many (? STORE_ID , Path , Options1 ).
909+ khepri :get_many (? STORE_ID , Path , Options ).
914910
915- exists (Path ) -> khepri :exists (? STORE_ID , Path , #{ favor => low_latency } ).
911+ exists (Path ) -> khepri :exists (? STORE_ID , Path ).
916912
917913list (Path ) ->
918914 khepri :get_many (
919- ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ], #{ favor => low_latency } ).
915+ ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ]).
920916
921917list_child_nodes (Path ) ->
922- Options = #{props_to_return => [child_names ],
923- favor => low_latency },
918+ Options = #{props_to_return => [child_names ]},
924919 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
925920 {ok , Result } ->
926921 case maps :values (Result ) of
@@ -934,8 +929,7 @@ list_child_nodes(Path) ->
934929 end .
935930
936931count_children (Path ) ->
937- Options = #{props_to_return => [child_list_length ],
938- favor => low_latency },
932+ Options = #{props_to_return => [child_list_length ]},
939933 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
940934 {ok , Map } ->
941935 lists :sum ([L || #{child_list_length := L } <- maps :values (Map )]);
@@ -986,18 +980,9 @@ transaction(Fun) ->
986980transaction (Fun , ReadWrite ) ->
987981 transaction (Fun , ReadWrite , #{}).
988982
989- transaction (Fun , ReadWrite , Options0 ) ->
990- % % If the transaction is read-only, use the same default options we use
991- % % for most queries.
992- DefaultQueryOptions = case ReadWrite of
993- ro ->
994- #{favor => low_latency };
995- _ ->
996- #{}
997- end ,
998- Options1 = maps :merge (DefaultQueryOptions , Options0 ),
999- Options = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options1 ),
1000- case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options ) of
983+ transaction (Fun , ReadWrite , Options ) ->
984+ Options1 = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options ),
985+ case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options1 ) of
1001986 ok -> ok ;
1002987 {ok , Result } -> Result ;
1003988 {error , Reason } -> throw ({error , Reason })
0 commit comments