diff options
| author | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-09-11 15:27:00 +0100 |
|---|---|---|
| committer | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-10-07 08:46:41 +0100 |
| commit | ebab0f780bbdeb41565c3759f3aca44a892b1a57 (patch) | |
| tree | ce050cd118bdb885f1a76ec575b8b40b67c7e3bd /src | |
| parent | 31eaf2f177260b194ddf62c7f6deb019ce8d3d60 (diff) | |
| download | rabbitmq-server-git-ebab0f780bbdeb41565c3759f3aca44a892b1a57.tar.gz | |
Updates 'Pid' variable to 'AggregatorPid'.
References #62
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue.erl | 26 | ||||
| -rw-r--r-- | src/rabbit_auth_backend_internal.erl | 30 | ||||
| -rw-r--r-- | src/rabbit_binding.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_channel.erl | 7 | ||||
| -rw-r--r-- | src/rabbit_exchange.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_networking.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_policy.erl | 11 | ||||
| -rw-r--r-- | src/rabbit_runtime_parameters.erl | 7 |
8 files changed, 53 insertions, 46 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 43ca26e406..cba083bea1 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -592,10 +592,11 @@ info_all(VHostPath, Items) -> map(list(VHostPath), fun (Q) -> info(Q, Items) end) ++ map(list_down(VHostPath), fun (Q) -> info_down(Q, Items, down) end). -info_all(VHostPath, Items, Ref, Pid) -> - map(list(VHostPath), fun (Q) -> Pid ! {Ref, info(Q, Items)} end) ++ - map(list_down(VHostPath), fun (Q) -> Pid ! {Ref, info_down(Q, Items, down)} end), - Pid ! {Ref, finished}, +info_all(VHostPath, Items, Ref, AggregatorPid) -> + map(list(VHostPath), fun (Q) -> AggregatorPid ! {Ref, info(Q, Items)} end) ++ + map(list_down(VHostPath), + fun (Q) -> AggregatorPid ! {Ref, info_down(Q, Items, down)} end), + AggregatorPid ! {Ref, finished}, ok. force_event_refresh(Ref) -> @@ -621,19 +622,20 @@ consumers_all(VHostPath) -> {ChPid, CTag, AckRequired, Prefetch, Args} <- consumers(Q)] end)). -consumers_all(VHostPath, Ref, Pid) -> +consumers_all(VHostPath, Ref, AggregatorPid) -> ConsumerInfoKeys=consumer_info_keys(), lists:append( map(list(VHostPath), fun (Q) -> - Pid ! {Ref, [lists:zip( - ConsumerInfoKeys, - [Q#amqqueue.name, ChPid, CTag, - AckRequired, Prefetch, Args]) || - {ChPid, CTag, AckRequired, Prefetch, Args} - <- consumers(Q)]} + AggregatorPid ! + {Ref, [lists:zip( + ConsumerInfoKeys, + [Q#amqqueue.name, ChPid, CTag, + AckRequired, Prefetch, Args]) || + {ChPid, CTag, AckRequired, Prefetch, Args} + <- consumers(Q)]} end)), - Pid ! {Ref, finished}, + AggregatorPid ! {Ref, finished}, ok. stat(#amqqueue{pid = QPid}) -> delegate:call(QPid, stat). diff --git a/src/rabbit_auth_backend_internal.erl b/src/rabbit_auth_backend_internal.erl index e2be6a3b9b..2f42aa1437 100644 --- a/src/rabbit_auth_backend_internal.erl +++ b/src/rabbit_auth_backend_internal.erl @@ -315,11 +315,11 @@ list_users() -> #internal_user{username = Username, tags = Tags} <- mnesia:dirty_match_object(rabbit_user, #internal_user{_ = '_'})]. -list_users(Ref, Pid) -> - [Pid ! {Ref, [{user, Username}, {tags, Tags}]} || +list_users(Ref, AggregatorPid) -> + [AggregatorPid ! {Ref, [{user, Username}, {tags, Tags}]} || #internal_user{username = Username, tags = Tags} <- mnesia:dirty_match_object(rabbit_user, #internal_user{_ = '_'})], - Pid ! {Ref, finished}, + AggregatorPid ! {Ref, finished}, ok. list_permissions() -> @@ -339,12 +339,12 @@ list_permissions(Keys, QueryThunk) -> %% TODO: use dirty ops instead rabbit_misc:execute_mnesia_transaction(QueryThunk)]. -list_permissions(Keys, QueryThunk, Ref, Pid) -> - [Pid ! {Ref, filter_props(Keys, [{user, Username}, - {vhost, VHostPath}, - {configure, ConfigurePerm}, - {write, WritePerm}, - {read, ReadPerm}])} || +list_permissions(Keys, QueryThunk, Ref, AggregatorPid) -> + [AggregatorPid ! {Ref, filter_props(Keys, [{user, Username}, + {vhost, VHostPath}, + {configure, ConfigurePerm}, + {write, WritePerm}, + {read, ReadPerm}])} || #user_permission{user_vhost = #user_vhost{username = Username, virtual_host = VHostPath}, @@ -353,7 +353,7 @@ list_permissions(Keys, QueryThunk, Ref, Pid) -> write = WritePerm, read = ReadPerm}} <- rabbit_misc:execute_mnesia_transaction(QueryThunk)], - Pid ! {Ref, finished}, + AggregatorPid ! {Ref, finished}, ok. filter_props(Keys, Props) -> [T || T = {K, _} <- Props, lists:member(K, Keys)]. @@ -363,20 +363,22 @@ list_user_permissions(Username) -> user_perms_info_keys(), rabbit_misc:with_user(Username, match_user_vhost(Username, '_'))). -list_user_permissions(Username, Ref, Pid) -> +list_user_permissions(Username, Ref, AggregatorPid) -> list_permissions( user_perms_info_keys(), - rabbit_misc:with_user(Username, match_user_vhost(Username, '_')), Ref, Pid). + rabbit_misc:with_user(Username, match_user_vhost(Username, '_')), + Ref, AggregatorPid). list_vhost_permissions(VHostPath) -> list_permissions( vhost_perms_info_keys(), rabbit_vhost:with(VHostPath, match_user_vhost('_', VHostPath))). -list_vhost_permissions(VHostPath, Ref, Pid) -> +list_vhost_permissions(VHostPath, Ref, AggregatorPid) -> list_permissions( vhost_perms_info_keys(), - rabbit_vhost:with(VHostPath, match_user_vhost('_', VHostPath)), Ref, Pid). + rabbit_vhost:with(VHostPath, match_user_vhost('_', VHostPath)), + Ref, AggregatorPid). list_user_vhost_permissions(Username, VHostPath) -> list_permissions( diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index c44575f2bb..50df60c899 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -286,9 +286,9 @@ info_all(VHostPath) -> map(VHostPath, fun (B) -> info(B) end). info_all(VHostPath, Items) -> map(VHostPath, fun (B) -> info(B, Items) end). -info_all(VHostPath, Items, Ref, Pid) -> - map(VHostPath, fun (B) -> Pid ! {Ref, info(B, Items)} end), - Pid ! {Ref, finished}, +info_all(VHostPath, Items, Ref, AggregatorPid) -> + map(VHostPath, fun (B) -> AggregatorPid ! {Ref, info(B, Items)} end), + AggregatorPid ! {Ref, finished}, ok. has_for_source(SrcName) -> diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 125b85cfc3..e7947493da 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -327,10 +327,11 @@ info_all() -> info_all(Items) -> rabbit_misc:filter_exit_map(fun (C) -> info(C, Items) end, list()). -info_all(Items, Ref, Pid) -> - rabbit_misc:filter_exit_map(fun (C) -> Pid ! {Ref, info(C, Items)} end, +info_all(Items, Ref, AggregatorPid) -> + rabbit_misc:filter_exit_map(fun (C) -> AggregatorPid ! + {Ref, info(C, Items)} end, list()), - Pid ! {Ref, finished}, + AggregatorPid ! {Ref, finished}, ok. refresh_config_local() -> diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index ce5af25d41..9c034e52e3 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -343,9 +343,9 @@ info_all(VHostPath) -> map(VHostPath, fun (X) -> info(X) end). info_all(VHostPath, Items) -> map(VHostPath, fun (X) -> info(X, Items) end). -info_all(VHostPath, Items, Ref, Pid) -> - map(VHostPath, fun (X) -> Pid ! {Ref, info(X, Items)} end), - Pid ! {Ref, finished}, +info_all(VHostPath, Items, Ref, AggregatorPid) -> + map(VHostPath, fun (X) -> AggregatorPid ! {Ref, info(X, Items)} end), + AggregatorPid ! {Ref, finished}, ok. route(#exchange{name = #resource{virtual_host = VHost, name = RName} = XName, diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 972b2e31cf..3abf36b52e 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -442,9 +442,9 @@ connection_info(Pid, Items) -> rabbit_reader:info(Pid, Items). connection_info_all() -> cmap(fun (Q) -> connection_info(Q) end). connection_info_all(Items) -> cmap(fun (Q) -> connection_info(Q, Items) end). -connection_info_all(Items, Ref, Pid) -> - cmap(fun (Q) -> Pid ! {Ref, connection_info(Q, Items)} end), - Pid ! {Ref, finished}, +connection_info_all(Items, Ref, AggregatorPid) -> + cmap(fun (Q) -> AggregatorPid ! {Ref, connection_info(Q, Items)} end), + AggregatorPid ! {Ref, finished}, ok. close_connection(Pid, Explanation) -> diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl index 2bd0241f05..198cc9d7e7 100644 --- a/src/rabbit_policy.erl +++ b/src/rabbit_policy.erl @@ -170,16 +170,17 @@ list(VHost) -> list_formatted(VHost) -> order_policies(list0(VHost, fun format/1)). -list_formatted(VHost, Ref, Pid) -> - list0(VHost, fun format/1, Ref, Pid), - Pid ! {Ref, finished}, +list_formatted(VHost, Ref, AggregatorPid) -> + list0(VHost, fun format/1, Ref, AggregatorPid), + AggregatorPid ! {Ref, finished}, ok. list0(VHost, DefnFun) -> [p(P, DefnFun) || P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)]. -list0(VHost, DefnFun, Ref, Pid) -> - [Pid ! {Ref, p(P, DefnFun)} || P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)]. +list0(VHost, DefnFun, Ref, AggregatorPid) -> + [AggregatorPid ! {Ref, p(P, DefnFun)} || + P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)]. order_policies(PropList) -> lists:sort(fun (A, B) -> pget(priority, A) < pget(priority, B) end, diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl index 910419c0d7..15d1dd9cba 100644 --- a/src/rabbit_runtime_parameters.erl +++ b/src/rabbit_runtime_parameters.erl @@ -199,9 +199,10 @@ list(VHost, Component) -> list_formatted(VHost) -> [pset(value, format(pget(value, P)), P) || P <- list(VHost)]. -list_formatted(VHost, Ref, Pid) -> - [Pid ! {Ref, pset(value, format(pget(value, P)), P)} || P <- list(VHost)], - Pid ! {Ref, finished}, +list_formatted(VHost, Ref, AggregatorPid) -> + [AggregatorPid ! + {Ref, pset(value, format(pget(value, P)), P)} || P <- list(VHost)], + AggregatorPid ! {Ref, finished}, ok. lookup(VHost, Component, Name) -> |
