Attempt to standardise on segment hashes

To allow for the segment has that accelerates queries to be re-used in tictac tree related queries.
This commit is contained in:
Martin Sumner 2017-10-30 13:57:41 +00:00
parent 7763df3cef
commit 6bb7ceef0c
4 changed files with 77 additions and 44 deletions

View file

@ -480,9 +480,9 @@ aae_indexspecs(AAE, Bucket, Key, SQN, H, LastMods) ->
Acc;
{LMD1, TTL} ->
TreeSize = AAE#recent_aae.tree_size,
SegID32 = leveled_tictac:keyto_segment32(Key),
SegID =
leveled_tictac:get_segment(erlang:phash2(Key),
TreeSize),
leveled_tictac:get_segment(SegID32, TreeSize),
IdxFldStr = ?NRT_IDX ++ LMD1 ++ "_bin",
IdxTrmStr =
string:right(integer_to_list(SegID), 8, $0) ++