Correct is_active

Firts part of adding support for scanning for Keys and Hashes.  as part
of this discovered TTL support did the opposite (only fetched things in
the past!).
This commit is contained in:
martinsumner 2016-10-31 16:02:32 +00:00
parent 2607792d1f
commit bd6c44e9b0
2 changed files with 107 additions and 1 deletions

View file

@ -58,6 +58,7 @@
generate_ledgerkv/4,
generate_ledgerkv/5,
get_size/2,
get_keyandhash/2,
convert_indexspecs/5,
riakto_keydetails/1,
generate_uuid/0,
@ -124,7 +125,7 @@ is_active(Key, Value, Now) ->
true;
tomb ->
false;
{active, TS} when Now >= TS ->
{active, TS} when TS >= Now ->
true;
{active, _TS} ->
false
@ -307,6 +308,18 @@ get_size(PK, Value) ->
Size
end.
get_keyandhash(LK, Value) ->
{Tag, Bucket, Key, _} = LK,
{_, _, MD} = Value,
case Tag of
?RIAK_TAG ->
{_RMD, _VC, Hash, _Size} = MD,
{Bucket, Key, Hash};
?STD_TAG ->
{Hash, _Size} = MD,
{Bucket, Key, Hash}
end.
build_metadata_object(PrimaryKey, MD) ->
{Tag, Bucket, Key, null} = PrimaryKey,