fix(ds): bitfield_lts: static_key_size -> static_key_bits
This commit is contained in:
parent
f84fb34692
commit
843973ef32
|
@ -416,7 +416,11 @@ get_id_for_key(#trie{is_binary_key = IsBin, static_key_size = Size}, State, Toke
|
|||
Hash = crypto:hash(sha256, term_to_binary([State | Token])),
|
||||
case IsBin of
|
||||
false ->
|
||||
<<Int:(Size * 8), _/bytes>> = Hash,
|
||||
%% Note: for backward compatibility with bitstream_lts
|
||||
%% layout we allow the key to be an integer. But this also
|
||||
%% changes the semantics of `static_key_size` from number
|
||||
%% of bytes to bits:
|
||||
<<Int:Size, _/bytes>> = Hash,
|
||||
Int;
|
||||
true ->
|
||||
element(1, erlang:split_binary(Hash, Size))
|
||||
|
|
|
@ -905,7 +905,7 @@ restore_trie(TopicIndexBytes, DB, CF) ->
|
|||
{ok, IT} = rocksdb:iterator(DB, CF, []),
|
||||
try
|
||||
Dump = read_persisted_trie(IT, rocksdb:iterator_move(IT, first)),
|
||||
TrieOpts = #{persist_callback => PersistCallback, static_key_size => TopicIndexBytes},
|
||||
TrieOpts = #{persist_callback => PersistCallback, static_key_bits => TopicIndexBytes * 8},
|
||||
emqx_ds_lts:trie_restore(TrieOpts, Dump)
|
||||
after
|
||||
rocksdb:iterator_close(IT)
|
||||
|
|
Loading…
Reference in New Issue