Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for v0 object in parallel-mode AAE #11

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/riak_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1282,23 +1282,21 @@ from_binary(_B, _K, Obj = #r_object{}) ->
Obj.


-spec summary_from_binary(binary()) ->
-spec summary_from_binary(binary()|riak_object()) ->
{vclock:vclock(), integer(), integer(),
list(erlang:timestamp())|undefined, binary()}.
%% @doc
%% Extract only sumarry infromation from the binary - the vector, the object
%% Extract only summary information from the binary - the vector, the object
%% size and the sibling count
summary_from_binary(<<131, _Rest/binary>>=ObjBin) ->
case binary_to_term(ObjBin) of
summary_from_binary(<<?MAGIC, _Rest/binary>>=ObjBin) ->
summary_from_binary(ObjBin, byte_size(ObjBin));
summary_from_binary(TermToBin) when is_binary(TermToBin) ->
case binary_to_term(TermToBin) of
{proxy_object, HeadBin, ObjSize, _Fetcher} ->
summary_from_binary(HeadBin, ObjSize);
T ->
{vclock(T), byte_size(ObjBin), value_count(T),
undefined, <<>>}
% Legacy object version will end up with dummy details
Objv0 ->
summary_from_binary(Objv0)
end;
summary_from_binary(ObjBin) when is_binary(ObjBin) ->
summary_from_binary(ObjBin, byte_size(ObjBin));
summary_from_binary(Object = #r_object{}) ->
% Unexpected scenario but included for parity with from_binary
% Calculating object size is expensive (relatively to other branches)
Expand Down
Loading