Просмотр исходного кода

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

ieQu1 1 год назад
Родитель
Сommit
3851fc189f

+ 0 - 3
apps/emqx_ds_builtin_raft/src/emqx_ds_replication_layer.erl

@@ -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() :: #{

+ 1 - 6
apps/emqx_durable_storage/src/emqx_ds.erl

@@ -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').

+ 1 - 1
apps/emqx_durable_storage/src/emqx_ds_builtin_metrics.erl

@@ -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]).
 

+ 1 - 1
apps/emqx_durable_storage/src/emqx_ds_storage_layer.erl

@@ -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()}].