fix(ds): Fix build

This commit is contained in:
ieQu1 2023-06-21 00:00:43 +02:00
parent b29c5ad23c
commit cfcd81e17b
6 changed files with 13 additions and 13 deletions

View File

@ -73,7 +73,7 @@
{ok, [message_id()]} | {error, _}. {ok, [message_id()]} | {error, _}.
message_store(_Msg, _Opts) -> message_store(_Msg, _Opts) ->
%% TODO %% TODO
ok. {error, not_implemented}.
-spec message_store([emqx_types:message()]) -> {ok, [message_id()]} | {error, _}. -spec message_store([emqx_types:message()]) -> {ok, [message_id()]} | {error, _}.
message_store(Msg) -> message_store(Msg) ->
@ -106,7 +106,7 @@ session_open(ClientID) ->
{false, ClientID, Iterators}; {false, ClientID, Iterators};
[] -> [] ->
Session = #session{id = ClientID, iterators = []}, Session = #session{id = ClientID, iterators = []},
mnesia:write(?SESSION_TAB, Session), mnesia:write(?SESSION_TAB, Session, write),
{true, ClientID, []} {true, ClientID, []}
end end
end end
@ -117,10 +117,10 @@ session_open(ClientID) ->
%% during session GC %% during session GC
-spec session_drop(emqx_types:clientid()) -> ok. -spec session_drop(emqx_types:clientid()) -> ok.
session_drop(ClientID) -> session_drop(ClientID) ->
{atomic, ok} = mnesia:transaction( {atomic, ok} = mria:transaction(
?DS_SHARD, ?DS_SHARD,
fun() -> fun() ->
mnesia:delete(?SESSION_TAB, ClientID) mnesia:delete({?SESSION_TAB, ClientID})
end end
), ),
ok. ok.
@ -146,7 +146,7 @@ session_add_iterator(_SessionId, _TopicFilter) ->
{ok, boolean()} | {error, session_not_found}. {ok, boolean()} | {error, session_not_found}.
session_del_iterator(_SessionId, _TopicFilter) -> session_del_iterator(_SessionId, _TopicFilter) ->
%% TODO %% TODO
false. {ok, false}.
-spec session_stats() -> #{}. -spec session_stats() -> #{}.
session_stats() -> session_stats() ->
@ -166,7 +166,7 @@ iterator_update(_IterId, _Iter) ->
-spec iterator_next(iterator()) -> {value, emqx_types:message(), iterator()} | none | {error, _}. -spec iterator_next(iterator()) -> {value, emqx_types:message(), iterator()} | none | {error, _}.
iterator_next(_Iter) -> iterator_next(_Iter) ->
%% TODO %% TODO
ok. none.
-spec iterator_stats() -> #{}. -spec iterator_stats() -> #{}.
iterator_stats() -> iterator_stats() ->

View File

@ -1,11 +1,11 @@
%% -*- mode: erlang -*- %% -*- mode: erlang -*-
{application, emqx_ds, [ {application, emqx_durable_storage, [
{description, "Message persistence and subscription replays for EMQX"}, {description, "Message persistence and subscription replays for EMQX"},
% strict semver, bump manually! % strict semver, bump manually!
{vsn, "0.1.0"}, {vsn, "0.1.0"},
{modules, []}, {modules, []},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, rocksdb, gproc]}, {applications, [kernel, stdlib, rocksdb, gproc, mria]},
{mod, {emqx_ds_app, []}}, {mod, {emqx_ds_app, []}},
{env, []} {env, []}
]}. ]}.

View File

@ -255,11 +255,11 @@ parse_topic(Topic) ->
all() -> emqx_common_test_helpers:all(?MODULE). all() -> emqx_common_test_helpers:all(?MODULE).
init_per_suite(Config) -> init_per_suite(Config) ->
{ok, _} = application:ensure_all_started(emqx_ds), {ok, _} = application:ensure_all_started(emqx_durable_storage),
Config. Config.
end_per_suite(_Config) -> end_per_suite(_Config) ->
ok = application:stop(emqx_ds). ok = application:stop(emqx_durable_storage).
init_per_testcase(TC, Config) -> init_per_testcase(TC, Config) ->
ok = set_shard_config(shard(TC), ?DEFAULT_CONFIG), ok = set_shard_config(shard(TC), ?DEFAULT_CONFIG),