anchor.diff:  %%% Internal functions
   %%%===================================================================
   
  -
  -
  +%% @doc
  +-spec get_manifests(pid(), binary(), binary()) ->
  +    {ok, term(), term()} | {error, notfound}.
  +get_manifests(RiakcPid, Bucket, Key) ->
  +    ManifestBucket = riak_moss_utils:to_bucket_name(objects, Bucket),
  +    case riakc_pb_socket:get(RiakcPid, ManifestBucket, Key) of
  +        {ok, Object} ->
  +            Siblings = riakc_obj:get_values(Object),
  +            DecodedSiblings = lists:map(fun erlang:binary_to_term/1, Siblings),
  +            Resolved = riak_moss_manifest_resolution:resolve(DecodedSiblings),
  +            {ok, Object, Resolved};
  +        {error, notfound} ->
  +            {error, notfound}
  +    end.
  
positive.code:         {error, Reason} ->
              lager:error("Failed to establish connection to Riak. Reason: ~p",
                          [Reason]),
              {stop, riak_connect_failed}
      end.
  
  %% This clause is for adding a new
  
negative.code: %% with a particular UUID, update_manifest
  %% should be used from then on out.
  waiting_command({add_new_manifest, _Manifest}, State) ->
      %% retrieve the current (resolved) value at {Bucket, Key},
      %% add the new manifest, and then write the value
      %% back to Riak
      %% NOTE: it would also be nice to assert that the
      %% UUID being added doesn't already exist in the
      %% dict
      {next_state, waiting_update_command, State}.
  
  waiting_update_command({update_manifest, _Manifest}, State) ->
      %% we'll either have a previously retrieved
      %% riak_object in our state, or we'll need to
      %% retrieve the (resolved) value from Riak.
  
      %% Then we need to update the manifest
      %% with this UUID and store the data
      %% back in Riak
      {next_state, waiting_update_command, State};
  waiting_update_command(stop, State) ->
      %% TODO:
      %% need to revisit this and remind myself
      %% the best way to deal with this
      %% w/r/t supervisors, and whether
      %% it's necessary to even use a supervisor
      {stop, normal, State}.
  
  
  