anchor.diff:      BufferSize = proplists:get_value(buffer_size, Opts0, DefaultBufSz),
       Buffer = BufferMod:new(BufferSize, ResultFun),
       Extras = fold_extras_keys(Index, Bucket),
  -    %% if Options contain ddl_mod, then we are folding keys for
  -    %% list_ts_keys
       FoldFunSelector = keys,
       FoldFun = fold_fun(FoldFunSelector, BufferMod, Filter, Extras),
       FinishFun = finish_fun(BufferMod, Sender),
  
positive.code:                     case Filter(Key) of
                          true ->
                              BufferMod:add(Key, Buffer);
                          false ->
                              Buffer
                      end;
                  _ ->
                      Buffer
              end
      end;
  fold_fun({keys, RecoverTsFun}, BufferMod, Filter, {Bucket, Index, N, NumPartitions}) ->
      fun(_, Key, Buffer) ->
              Hash = riak_core_util:chash_key({Bucket, Key}),
              case riak_core_ring:future_index(Hash, Index, N, NumPartitions, NumPartitions) of
                  Index ->
                      CompoundKey = RecoverTsFun(Key),
                      case Filter(CompoundKey) of
                          true ->
                              BufferMod:add(CompoundKey, Buffer);
                          false ->
                              Buffer
                      end;
  
negative.code:     fun(_, Key, Buffer) ->
              BufferMod:add(Key, Buffer)
      end;
  fold_fun(keys, BufferMod, none, {Bucket, Index, N, NumPartitions}) ->
      fun(_, Key, Buffer) ->
              Hash = riak_core_util:chash_key({Bucket, Key}),
              case riak_core_ring:future_index(Hash, Index, N, NumPartitions, NumPartitions) of
                  Index ->
                      BufferMod:add(Key, Buffer);
                  _ ->
                      Buffer
              end
  