fix(ds): Avoid reverse dependencies from storage to repl. layer

This commit is contained in:
ieQu1 2024-06-17 10:21:28 +02:00
parent bc915216a0
commit 3851fc189f
No known key found for this signature in database
GPG Key ID: 488654DF3FED6FDE
4 changed files with 3 additions and 11 deletions

View File

@ -73,7 +73,6 @@
delete_stream/0,
iterator/0,
delete_iterator/0,
message_id/0,
batch/0
]).
@ -133,8 +132,6 @@
?enc := emqx_ds_storage_layer:delete_iterator()
}.
-type message_id() :: emqx_ds:message_id().
%% TODO: this type is obsolete and is kept only for compatibility with
%% BPAPIs. Remove it when emqx_ds_proto_v4 is gone (EMQX 5.6)
-type batch() :: #{

View File

@ -16,9 +16,7 @@
%% @doc Main interface module for `emqx_durable_storage' application.
%%
%% It takes care of forwarding calls to the underlying DBMS. Currently
%% only the embedded `emqx_ds_replication_layer' storage is supported,
%% so all the calls are simply passed through.
%% It takes care of forwarding calls to the underlying DBMS.
-module(emqx_ds).
%% Management API:
@ -63,7 +61,6 @@
iterator/0,
delete_iterator/0,
iterator_id/0,
message_id/0,
message_key/0,
message_store_opts/0,
next_result/1, next_result/0,
@ -178,8 +175,6 @@
-type create_db_opts() :: generic_db_opts().
-type message_id() :: emqx_ds_replication_layer:message_id().
%% An opaque term identifying a generation. Each implementation will possibly add
%% information to this term to match its inner structure (e.g.: by embedding the shard id,
%% in the case of `emqx_ds_replication_layer').

View File

@ -96,7 +96,7 @@ child_spec() ->
init_for_db(DB) ->
emqx_metrics_worker:create_metrics(?WORKER, DB, ?DB_METRICS, []).
-spec shard_metric_id(emqx_ds:db(), emqx_ds_replication_layer:shard_id()) -> shard_metrics_id().
-spec shard_metric_id(emqx_ds:db(), binary()) -> shard_metrics_id().
shard_metric_id(DB, ShardId) ->
iolist_to_binary([atom_to_list(DB), $/, ShardId]).

View File

@ -106,7 +106,7 @@
{emqx_ds_storage_reference, emqx_ds_storage_reference:options()}
| {emqx_ds_storage_bitfield_lts, emqx_ds_storage_bitfield_lts:options()}.
-type shard_id() :: {emqx_ds:db(), emqx_ds_replication_layer:shard_id()}.
-type shard_id() :: {emqx_ds:db(), binary()}.
-type cf_refs() :: [{string(), rocksdb:cf_handle()}].