diff --git a/deps/rabbit/src/rabbit_definitions.erl b/deps/rabbit/src/rabbit_definitions.erl index 5d81f67040d3..eceaad063880 100644 --- a/deps/rabbit/src/rabbit_definitions.erl +++ b/deps/rabbit/src/rabbit_definitions.erl @@ -43,7 +43,7 @@ %% import -export([import_raw/1, import_raw/2, import_parsed/1, import_parsed/2, import_parsed_with_hashing/1, import_parsed_with_hashing/2, - apply_defs/2, apply_defs/3, apply_defs/4, apply_defs/5, + apply_defs/2, apply_defs/3, should_skip_if_unchanged/0]). -export([all_definitions/0]). @@ -465,44 +465,6 @@ apply_defs(Map, ActingUser, SuccessFun, VHost) when is_function(SuccessFun); is_ rabbit_runtime:gc_all_processes() end. --spec apply_defs(Map :: #{atom() => any()}, - ActingUser :: rabbit_types:username(), - SuccessFun :: fun(() -> 'ok'), - ErrorFun :: fun((any()) -> 'ok'), - VHost :: vhost:name()) -> 'ok' | {error, term()}. - -apply_defs(Map, ActingUser, SuccessFun, ErrorFun, VHost) -> - rabbit_log:info("Asked to import definitions for a virtual host. Virtual host: ~tp, acting user: ~tp", - [VHost, ActingUser]), - try - validate_limits(Map, VHost), - - concurrent_for_all(bindings, ActingUser, Map, VHost, fun add_binding/3), - sequential_for_all(parameters, ActingUser, Map, VHost, fun add_parameter/3), - %% importing policies concurrently can be unsafe as queues will be getting - %% potentially out of order notifications of applicable policy changes - sequential_for_all(policies, ActingUser, Map, VHost, fun add_policy/3), - - rabbit_nodes:if_reached_target_cluster_size( - fun() -> - concurrent_for_all(queues, ActingUser, Map, VHost, fun add_queue/3), - concurrent_for_all(bindings, ActingUser, Map, VHost, fun add_binding/3) - end, - - fun() -> - rabbit_log:info("There are fewer than target cluster size (~b) nodes online," - " skipping queue and binding import from definitions", - [rabbit_nodes:target_cluster_size_hint()]) - end - ), - - SuccessFun() - catch {error, E} -> ErrorFun(format(E)); - exit:E -> ErrorFun(format(E)) - after - rabbit_runtime:gc_all_processes() - end. - sequential_for_all(Category, ActingUser, Definitions, Fun) -> try sequential_for_all0(Category, ActingUser, Definitions, Fun) diff --git a/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl b/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl index 000704b0f866..3abe012735cd 100644 --- a/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl +++ b/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl @@ -12,8 +12,6 @@ -export([accept_multipart/2]). -export([variances/2]). --export([apply_defs/3, apply_defs/5]). - -import(rabbit_misc, [pget/2]). -include("rabbit_mgmt.hrl"). @@ -211,15 +209,6 @@ apply_defs(Body, ActingUser) -> apply_defs(Body, ActingUser, VHost) -> rabbit_definitions:apply_defs(Body, ActingUser, VHost). --spec apply_defs(Map :: #{atom() => any()}, - ActingUser :: rabbit_types:username(), - SuccessFun :: fun(() -> 'ok'), - ErrorFun :: fun((any()) -> 'ok'), - VHost :: vhost:name()) -> 'ok' | {error, term()}. - -apply_defs(Body, ActingUser, SuccessFun, ErrorFun, VHost) -> - rabbit_definitions:apply_defs(Body, ActingUser, SuccessFun, ErrorFun, VHost). - get_all_parts(Req) -> get_all_parts(Req, []).