From 60b0b8822608574d3477df12ed4e60e90521bedf Mon Sep 17 00:00:00 2001 From: martinsumner Date: Fri, 7 Apr 2017 17:08:40 +0000 Subject: [PATCH] Switch to binary response Force header in fold_heads to be a binary ... as this is what KV expects --- src/leveled_bookie.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/leveled_bookie.erl b/src/leveled_bookie.erl index 41acd1c..e70abbd 100644 --- a/src/leveled_bookie.erl +++ b/src/leveled_bookie.erl @@ -1091,7 +1091,7 @@ accumulate_objects(FoldObjectsFun, InkerClone, Tag, DeferredFetch) -> MDBin, Size, {fun fetch_value/2, InkerClone, JK}}, - FoldObjectsFun(B, K, Value, Acc); + FoldObjectsFun(B, K, term_to_binary(Value), Acc); false -> R = fetch_value(InkerClone, JK), case R of @@ -1520,7 +1520,7 @@ foldobjects_vs_hashtree_test() -> {proxy_object, _MDBin, _Size, - {FetchFun, Clone, JK}} = ProxyV, + {FetchFun, Clone, JK}} = binary_to_term(ProxyV), V = FetchFun(Clone, JK), [{B, K, erlang:phash2(term_to_binary(V))}|Acc] end, @@ -1536,7 +1536,7 @@ foldobjects_vs_hashtree_test() -> {proxy_object, MD, _Size, - _Fetcher} = ProxyV, + _Fetcher} = binary_to_term(ProxyV), {Hash, _Size} = MD, [{B, K, Hash}|Acc] end, @@ -1595,7 +1595,7 @@ foldobjects_vs_foldheads_bybucket_test() -> {proxy_object, _MDBin, _Size, - {FetchFun, Clone, JK}} = ProxyV, + {FetchFun, Clone, JK}} = binary_to_term(ProxyV), V = FetchFun(Clone, JK), [{B, K, erlang:phash2(term_to_binary(V))}|Acc] end,