99
1010-include_lib (" rabbit_common/include/rabbit.hrl" ).
1111
12- -export ([set / 1 , delete_all_for_exchange / 1 , delete / 1 , match /3 ]).
12+ -export ([match /3 ]).
1313
1414% % Used by Khepri projections and the Mnesia-to-Khepri migration.
15- -export ([
16- split_topic_key /1 ,
17- split_topic_key_binary /1
18- ]).
19-
20- % % For testing
21- -export ([clear /0 ]).
15+ -export ([split_topic_key_binary /1 ]).
2216
2317-define (KHEPRI_PROJECTION , rabbit_khepri_topic_trie_v3 ).
2418
2721
2822-define (COMPILED_TOPIC_SPLIT_PATTERN , cp_dot ).
2923
30- % % -------------------------------------------------------------------
31- % % set().
32- % % -------------------------------------------------------------------
33-
34- -spec set (Binding ) -> ok when
35- Binding :: rabbit_types :binding ().
36- % % @doc Sets a topic binding.
37- % %
38- % % @private
39-
40- set (# binding {}) ->
41- ok .
42-
43- % % -------------------------------------------------------------------
44- % % delete_all_for_exchange().
45- % % -------------------------------------------------------------------
46-
47- -spec delete_all_for_exchange (ExchangeName ) -> ok when
48- ExchangeName :: rabbit_exchange :name ().
49- % % @doc Deletes all topic bindings for the exchange named `ExchangeName'
50- % %
51- % % @private
52-
53- delete_all_for_exchange (_XName ) ->
54- ok .
55-
56- % % -------------------------------------------------------------------
57- % % delete().
58- % % -------------------------------------------------------------------
59-
60- -spec delete ([Binding ]) -> ok when
61- Binding :: rabbit_types :binding ().
62- % % @doc Deletes all given topic bindings
63- % %
64- % % @private
65-
66- delete (Bs ) when is_list (Bs ) ->
67- ok .
68-
69- % % -------------------------------------------------------------------
70- % % match().
71- % % -------------------------------------------------------------------
72-
7324-spec match (rabbit_exchange :name (),
7425 rabbit_types :routing_key (),
7526 rabbit_exchange :route_opts ()) -> match_result ().
@@ -85,38 +36,6 @@ match(XName, RoutingKey, Opts) ->
8536 Words = split_topic_key_binary (RoutingKey ),
8637 trie_match_in_khepri (XName , Words , BKeys ).
8738
88- % % -------------------------------------------------------------------
89- % % clear().
90- % % -------------------------------------------------------------------
91-
92- -spec clear () -> ok .
93- % % @doc Deletes all topic bindings
94- % %
95- % % @private
96-
97- clear () ->
98- ok .
99-
100- % % --------------------------------------------------------------
101- % % split_topic_key().
102- % % --------------------------------------------------------------
103-
104- -spec split_topic_key (RoutingKey ) -> Words when
105- RoutingKey :: binary (),
106- Words :: [[byte ()]].
107-
108- split_topic_key (Key ) ->
109- split_topic_key (Key , [], []).
110-
111- split_topic_key (<<>>, [], []) ->
112- [];
113- split_topic_key (<<>>, RevWordAcc , RevResAcc ) ->
114- lists :reverse ([lists :reverse (RevWordAcc ) | RevResAcc ]);
115- split_topic_key (<<$. , Rest /binary >>, RevWordAcc , RevResAcc ) ->
116- split_topic_key (Rest , [], [lists :reverse (RevWordAcc ) | RevResAcc ]);
117- split_topic_key (<<C :8 , Rest /binary >>, RevWordAcc , RevResAcc ) ->
118- split_topic_key (Rest , [C | RevWordAcc ], RevResAcc ).
119-
12039% % --------------------------------------------------------------
12140% % split_topic_key_binary().
12241% % --------------------------------------------------------------
0 commit comments