summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-09-24 14:58:49 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-09-24 14:58:49 +0100
commitfb546cf5902454dd0e1d135a432cd775a2ec82aa (patch)
treefbbdc9e16359df7dee8c541a0946a6f71f9d5aad
parentf5a7992675e764f45f75141d4381401b6ba8647d (diff)
downloadrabbitmq-server-fb546cf5902454dd0e1d135a432cd775a2ec82aa.tar.gz
inline is_only_node
-rw-r--r--src/rabbit_mnesia.erl13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 63f128bc..30bfa61f 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -339,9 +339,8 @@ is_db_empty() ->
lists:all(fun (Tab) -> mnesia:dirty_first(Tab) == '$end_of_table' end,
table_names()).
-is_clustered() ->
- AllNodes = cluster_nodes(all),
- AllNodes =/= [] andalso not is_only_node(AllNodes).
+is_clustered() -> AllNodes = cluster_nodes(all),
+ AllNodes =/= [] andalso AllNodes =/= [node()].
%% This function is the actual source of information, since it gets
%% the data from mnesia. Obviously it'll work only when mnesia is
@@ -642,7 +641,7 @@ check_cluster_consistency(Node) ->
%%--------------------------------------------------------------------
on_node_up(Node) ->
- case is_only_node(Node, running_disc_nodes()) of
+ case running_disc_nodes() =:= [Node] of
true -> rabbit_log:info("cluster contains disc nodes again~n");
false -> ok
end.
@@ -1077,11 +1076,7 @@ find_good_node([Node | Nodes]) ->
is_only_clustered_disc_node() ->
node_type() =:= disc andalso is_clustered() andalso
- is_only_node(cluster_nodes(disc)).
-
-is_only_node(Node, Nodes) -> Nodes =:= [Node].
-
-is_only_node(Nodes) -> is_only_node(node(), Nodes).
+ cluster_nodes(disc) =:= [node()].
me_in_nodes(Nodes) -> lists:member(node(), Nodes).