feat: turn tables queried with search APIs into ordered sets
This is needed to ensure more or less consistent client experience for the new planned cursor-based search APIs.
This commit is contained in:
parent
a7fc5e8fe1
commit
ce2dba15b4
|
@ -89,7 +89,7 @@ mnesia(boot) ->
|
|||
ok = mria:create_table(
|
||||
?ACTIVATED_ALARM,
|
||||
[
|
||||
{type, set},
|
||||
{type, ordered_set},
|
||||
{storage, disc_copies},
|
||||
{local_content, true},
|
||||
{record_name, activated_alarm},
|
||||
|
|
|
@ -107,7 +107,7 @@ create_tabs() ->
|
|||
TabOpts = [public, {read_concurrency, true}, {write_concurrency, true}],
|
||||
|
||||
%% SubOption: {SubPid, Topic} -> SubOption
|
||||
ok = emqx_tables:new(?SUBOPTION, [set | TabOpts]),
|
||||
ok = emqx_tables:new(?SUBOPTION, [ordered_set | TabOpts]),
|
||||
|
||||
%% Subscription: SubPid -> Topic1, Topic2, Topic3, ...
|
||||
%% duplicate_bag: o(1) insert
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
mnesia(boot) ->
|
||||
ok = mria:create_table(?TAB, [
|
||||
{rlog_shard, ?AUTH_SHARD},
|
||||
{type, ordered_set},
|
||||
{storage, disc_copies},
|
||||
{record_name, user_info},
|
||||
{attributes, record_info(fields, user_info)},
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
mnesia(boot) ->
|
||||
ok = mria:create_table(?TAB, [
|
||||
{rlog_shard, ?AUTH_SHARD},
|
||||
{type, ordered_set},
|
||||
{storage, disc_copies},
|
||||
{record_name, user_info},
|
||||
{attributes, record_info(fields, user_info)},
|
||||
|
|
|
@ -768,7 +768,7 @@ init(Options) ->
|
|||
{ChanTab, ConnTab, InfoTab} = cmtabs(GwName),
|
||||
ok = emqx_tables:new(ChanTab, [bag, {read_concurrency, true} | TabOpts]),
|
||||
ok = emqx_tables:new(ConnTab, [bag | TabOpts]),
|
||||
ok = emqx_tables:new(InfoTab, [set, compressed | TabOpts]),
|
||||
ok = emqx_tables:new(InfoTab, [ordered_set, compressed | TabOpts]),
|
||||
|
||||
%% Start link cm-registry process
|
||||
%% XXX: Should I hang it under a higher level supervisor?
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
-export([stop/1]).
|
||||
|
||||
start(_Type, _Args) ->
|
||||
_ = ets:new(?RULE_TAB, [named_table, public, set, {read_concurrency, true}]),
|
||||
_ = ets:new(?RULE_TAB, [named_table, public, ordered_set, {read_concurrency, true}]),
|
||||
ok = emqx_rule_events:reload(),
|
||||
SupRet = emqx_rule_engine_sup:start_link(),
|
||||
ok = emqx_rule_engine:load_rules(),
|
||||
|
|
Loading…
Reference in New Issue