|
12 | 12 | wait_for_replicated/1, wait/1, wait/2, |
13 | 13 | force_load/0, is_present/0, is_empty/0, needs_default_data/0, |
14 | 14 | check_schema_integrity/1, clear_ram_only_tables/0, retry_timeout/0, |
15 | | - wait_for_replicated/0, exists/1]). |
16 | | - |
17 | | --export([rabbit_index_route_definition/0]). |
| 15 | + wait_for_replicated/0]). |
18 | 16 |
|
19 | 17 | %% for testing purposes |
20 | 18 | -export([definitions/0]). |
@@ -52,17 +50,6 @@ create(TableName, TableDefinition) -> |
52 | 50 | throw({error, {table_creation_failed, TableName, TableDefinition1, Reason}}) |
53 | 51 | end. |
54 | 52 |
|
55 | | --spec exists(atom()) -> boolean(). |
56 | | -exists(Table) -> |
57 | | - case mnesia:is_transaction() of |
58 | | - true -> |
59 | | - _ = mnesia_schema:get_tid_ts_and_lock(schema, read), |
60 | | - ok; |
61 | | - false -> |
62 | | - ok |
63 | | - end, |
64 | | - lists:member(Table, mnesia:system_info(tables)). |
65 | | - |
66 | 53 | %% Sets up secondary indexes in a blank node database. |
67 | 54 | ensure_secondary_indexes() -> |
68 | 55 | ensure_secondary_index(rabbit_queue, vhost), |
@@ -356,6 +343,14 @@ definitions() -> |
356 | 343 | {type, ordered_set}, |
357 | 344 | {match, #reverse_route{reverse_binding = reverse_binding_match(), |
358 | 345 | _='_'}}]}, |
| 346 | + {rabbit_index_route, |
| 347 | + [{record_name, index_route}, |
| 348 | + {attributes, record_info(fields, index_route)}, |
| 349 | + {type, bag}, |
| 350 | + {storage_properties, [{ets, [{read_concurrency, true}]}]}, |
| 351 | + {match, #index_route{source_key = {exchange_name_match(), '_'}, |
| 352 | + destination = binding_destination_match(), |
| 353 | + _='_'}}]}, |
359 | 354 | {rabbit_topic_trie_node, |
360 | 355 | [{record_name, topic_trie_node}, |
361 | 356 | {attributes, record_info(fields, topic_trie_node)}, |
@@ -403,29 +398,13 @@ definitions() -> |
403 | 398 | ++ gm:table_definitions() |
404 | 399 | ++ mirrored_supervisor:table_definitions(), |
405 | 400 |
|
406 | | - MaybeRouting = case rabbit_feature_flags:is_enabled(direct_exchange_routing_v2) of |
407 | | - true -> |
408 | | - [{rabbit_index_route, rabbit_index_route_definition()}]; |
409 | | - false -> |
410 | | - [] |
411 | | - end, |
412 | 401 | MaybeListener = case rabbit_feature_flags:is_enabled(listener_records_in_ets) of |
413 | 402 | false -> |
414 | 403 | [{rabbit_listener, rabbit_listener_definition()}]; |
415 | 404 | true -> |
416 | 405 | [] |
417 | 406 | end, |
418 | | - Definitions ++ MaybeRouting ++ MaybeListener. |
419 | | - |
420 | | --spec rabbit_index_route_definition() -> list(tuple()). |
421 | | -rabbit_index_route_definition() -> |
422 | | - [{record_name, index_route}, |
423 | | - {attributes, record_info(fields, index_route)}, |
424 | | - {type, bag}, |
425 | | - {storage_properties, [{ets, [{read_concurrency, true}]}]}, |
426 | | - {match, #index_route{source_key = {exchange_name_match(), '_'}, |
427 | | - destination = binding_destination_match(), |
428 | | - _='_'}}]. |
| 407 | + Definitions ++ MaybeListener. |
429 | 408 |
|
430 | 409 | rabbit_listener_definition() -> |
431 | 410 | [{record_name, listener}, |
|
0 commit comments