Skip to content

Commit 778c0d2

Browse files
committed
Khepri: Clean up the proxy functions of the integration code
[Why] The `rabbit_khepri` module grew during the work to add Khepri support to RabbitMQ and while Khepri was itself written. The current code is therefore unorganized. [How] This commit tries to change proxy functions to be close to their Khepri equivalent. The module continues to set non-default options for write functions. We also add the variants that take an option map to be consistent and not have to deal with that in the future. Several legacy functions were removed, either because they were no longer called or because they were replace by a regular Khepri call.
1 parent bd3aee3 commit 778c0d2

File tree

6 files changed

+191
-173
lines changed

6 files changed

+191
-173
lines changed

deps/rabbit/src/rabbit_db.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ list_in_khepri(Path) ->
328328
Objects :: [term()].
329329

330330
list_in_khepri(Path, Options) ->
331-
case rabbit_khepri:match(Path, Options) of
331+
case rabbit_khepri:get_many(Path, Options) of
332332
{ok, Map} -> maps:values(Map);
333333
_ -> []
334334
end.

deps/rabbit/src/rabbit_db_rtparams.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ delete_vhost_in_mnesia_tx(VHostName) ->
357357
delete_vhost_in_khepri(VHostName) ->
358358
Pattern = khepri_vhost_rp_path(
359359
VHostName, ?KHEPRI_WILDCARD_STAR, ?KHEPRI_WILDCARD_STAR),
360-
case rabbit_khepri:adv_delete_many(Pattern) of
360+
case rabbit_khepri:adv_delete(Pattern) of
361361
{ok, NodePropsMap} ->
362362
RTParams =
363363
maps:fold(

deps/rabbit/src/rabbit_db_user.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ match_user_permissions_in_mnesia_tx(Username, VHostName) ->
402402

403403
match_user_permissions_in_khepri('_' = _Username, '_' = _VHostName) ->
404404
Path = khepri_user_permission_path(?KHEPRI_WILDCARD_STAR, ?KHEPRI_WILDCARD_STAR),
405-
case rabbit_khepri:match(Path) of
405+
case rabbit_khepri:get_many(Path) of
406406
{ok, Map} ->
407407
maps:values(Map);
408408
_ ->

0 commit comments

Comments
 (0)