summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-08-23 18:17:50 +0100
committerMatthew Sackman <matthew@lshift.net>2009-08-23 18:17:50 +0100
commit8206cdac49f636f4d59969cce7d11a14ba3ff97f (patch)
tree7229a3585758702a7972ad38ed196ddb1b2e5a44
parentfcc85d2adfe47a717b447193206ff65d49322f62 (diff)
downloadrabbitmq-server-8206cdac49f636f4d59969cce7d11a14ba3ff97f.tar.gz
done
-rw-r--r--src/rabbit_mnesia.erl20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index dedcf85c..17ff6886 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -146,16 +146,13 @@ table_definitions() ->
[{record_name, amqqueue},
{attributes, record_info(fields, amqqueue)}]}].
-replicated_table_definitions() ->
- [{Tab, Attrs} || {Tab, Attrs} <- table_definitions(),
- not lists:member({local_content, true}, Attrs)
- ].
-
table_names() ->
[Tab || {Tab, _} <- table_definitions()].
replicated_table_names() ->
- [Tab || {Tab, _} <- replicated_table_definitions()].
+ [Tab || {Tab, Attrs} <- table_definitions(),
+ not lists:member({local_content, true}, Attrs)
+ ].
dir() -> mnesia:system_info(directory).
@@ -339,16 +336,13 @@ create_tables() ->
ok.
table_has_copy_type(TabDef, DiscType) ->
- case lists:keysearch(DiscType, 1, TabDef) of
+ case proplists:get_value(DiscType, TabDef, false) of
false -> false;
- {value, {DiscType, List}} -> lists:member(node(), List)
+ List -> lists:member(node(), List)
end.
is_local_content_table(TabDef) ->
- case lists:keysearch(local_content, 1, TabDef) of
- false -> false;
- {value, {local_content, Bool}} -> Bool
- end.
+ proplists:get_bool(local_content, TabDef).
create_local_table_copies(Type) ->
lists:foreach(
@@ -385,8 +379,6 @@ create_local_table_copy(Tab, TabDef, LocalTab, Type) ->
if
StorageType == unknown ->
mnesia:add_table_copy(Tab, node(), Type);
- LocalTab andalso StorageType /= Type andalso Tab /= schema ->
- mnesia:create_table(Tab, TabDef);
StorageType /= Type ->
mnesia:change_table_copy_type(Tab, node(), Type);
true -> {atomic, ok}