fix(ds): Apply review remarks

This commit is contained in:
ieQu1 2023-06-22 17:07:30 +02:00
parent cfcd81e17b
commit 9a81f22105
3 changed files with 19 additions and 17 deletions

View File

@ -39,7 +39,10 @@
message_store_opts/0, message_store_opts/0,
session_id/0, session_id/0,
iterator_id/0, iterator_id/0,
iterator/0 iterator/0,
shard/0,
topic/0,
time/0
]). ]).
-include("emqx_ds_int.hrl"). -include("emqx_ds_int.hrl").
@ -62,6 +65,16 @@
-type message_id() :: binary(). -type message_id() :: binary().
%% Parsed topic:
-type topic() :: list(binary()).
-type shard() :: binary().
%% Timestamp
%% Earliest possible timestamp is 0.
%% TODO granularity?
-type time() :: non_neg_integer().
%%================================================================================ %%================================================================================
%% API funcions %% API funcions
%%================================================================================ %%================================================================================

View File

@ -38,9 +38,9 @@
%% to map topics to fixed-length bitstrings while keeping some degree %% to map topics to fixed-length bitstrings while keeping some degree
%% of information about the hierarchy. %% of information about the hierarchy.
%% %%
%% Next important concept is what we call "epoch". It is time %% Next important concept is what we call "epoch". Duration of the
%% interval determined by the number of least significant bits of the %% epoch is determined by maximum time offset. Epoch is calculated by
%% timestamp found at the tail of the rocksdb key. %% shifting bits of the timestamp right.
%% %%
%% The resulting index is a space-filling curve that looks like %% The resulting index is a space-filling curve that looks like
%% this in the topic-time 2D space: %% this in the topic-time 2D space:

View File

@ -6,28 +6,17 @@
%% API: %% API:
-export([]). -export([]).
-export_type([topic/0, time/0, shard/0]).
-export_type([replay_id/0, replay/0]). -export_type([replay_id/0, replay/0]).
%%================================================================================ %%================================================================================
%% Type declarations %% Type declarations
%%================================================================================ %%================================================================================
%% parsed
-type topic() :: list(binary()).
-type shard() :: binary().
%% Timestamp
%% Earliest possible timestamp is 0.
%% TODO granularity?
-type time() :: non_neg_integer().
-type replay_id() :: binary(). -type replay_id() :: binary().
-type replay() :: { -type replay() :: {
_TopicFilter :: topic(), _TopicFilter :: emqx_ds:topic(),
_StartTime :: time() _StartTime :: emqx_ds:time()
}. }.
%%================================================================================ %%================================================================================