Add new book_headonly/4 API

To address special situation of performing a head requets in head_only mode - where a sub-key is a required input.
This commit is contained in:
Martin Sumner 2018-09-20 12:08:33 +01:00
parent f4a7a729ae
commit c439e4144a
2 changed files with 20 additions and 6 deletions

View file

@ -1107,14 +1107,14 @@ basic_headonly_test(ObjectCount, RemoveCount, HeadOnly) ->
% If we allow HEAD_TAG to be suubject to a lookup, then test this
% here
{ok, Hash0} =
leveled_bookie:book_head(Bookie1,
SegmentID0,
{Bucket0, Key0},
h),
leveled_bookie:book_headonly(Bookie1,
SegmentID0,
Bucket0,
Key0),
CheckHeadFun =
fun({add, SegID, B, K, H}) ->
{ok, H} =
leveled_bookie:book_head(Bookie1, SegID, {B, K}, h)
leveled_bookie:book_headonly(Bookie1, SegID, B, K)
end,
lists:foreach(CheckHeadFun, ObjectSpecL);
no_lookup ->
@ -1122,7 +1122,12 @@ basic_headonly_test(ObjectCount, RemoveCount, HeadOnly) ->
leveled_bookie:book_head(Bookie1,
SegmentID0,
{Bucket0, Key0},
h)
h),
{unsupported_message, head} =
leveled_bookie:book_headonly(Bookie1,
SegmentID0,
Bucket0,
Key0)
end,