anchor.diff:      create_traditional_plan(VNodeTarget, NVal, PVC, ReqId, Service,
                               CHBin, ?AVAIL_NODE_FUN).
   
  -%% @doc The format for the return from this function is specifically
  -%% tied to the needs of `riak_core_coverage_fsm:initialize'
  --spec interpret_plan(vnode_coverage()) ->
  -                            {list({index(), node()}),
  -                             list({index(), list(index())|tuple()})}.
  -interpret_plan(#vnode_coverage{vnode_identifier=TargetHash,
  -                               subpartition={Mask, BSL}}) ->
  -    {[{TargetHash, node()}], [{TargetHash, {Mask, BSL}}]};
  -interpret_plan(#vnode_coverage{vnode_identifier=TargetHash,
  -                               partition_filters=[]}) ->
  -    {[{TargetHash, node()}], []};
  -interpret_plan(#vnode_coverage{vnode_identifier=TargetHash,
  -                            partition_filters=HashFilters}) ->
  -    {[{TargetHash, node()}], [{TargetHash, HashFilters}]}.
  -
  -partition_to_preflist(Partition, NVal, Offset, UpNodes, CHBin) ->
  -    DocIdx = convert(Partition, partition_index),
  -    docidx_to_preflist(DocIdx, NVal, Offset, UpNodes, CHBin).
  -
  -docidx_to_preflist(DocIdx, NVal, Offset, UpNodes, CHBin) ->
  -    %% `chashbin' would be fine with a straight integer, but
  -    %% `riak_core_apl' has a -spec that mandates binary(), so we'll
  -    %% play its game
  -    OrigPreflist =
  -        lists:map(fun({{Idx, Node}, primary}) -> {Idx, Node} end,
  -                  riak_core_apl:get_primary_apl_chbin(
  -                    <<DocIdx:160/integer>>, NVal, CHBin, UpNodes)),
  -    rotate_list(OrigPreflist, length(OrigPreflist), Offset).
  -
  -rotate_list(List, Len, Offset) when Offset >= Len ->
  -    List;
  -rotate_list(List, _Len, Offset) ->
  -    {Head, Tail} = lists:split(Offset, List),
  -    Tail ++ Head.
  -
  +%% @doc Create a "mini" traditional coverage plan to replace
  +%%      components of a previously-generated plan that are not useful
  +%%      to the client because the node is unavailable
   -spec replace_traditional_chunk(VnodeIdx :: index(),
                                   Node :: node(),
                                   Filters :: list(index()),
  
positive.code:             end
      end.
  
  %% ====================================================================
  %% Internal functions
  %% ====================================================================
  
  %% @private
  %% Adding an offset while keeping the result inside [0, Top). Adding
  %% Top to the left of `rem' allows offset to be negative without
  %% violating the lower bound of zero
  add_offset(Position, Offset, Top) ->
      (Position + (Top + Offset)) rem Top.
  
  %% @private
  %% Convert(from, to)
  %% We spend a lot of code mapping between data types, mostly
  %% integer-based. Consolidate that as much as possible here.
  -spec convert(partition_id() | vnode_id() | subpartition_id(), atom()) ->
  
negative.code:                               ReqId, DownNodes, Service, CHBin,
                                ?AVAIL_NODE_FUN).
  
  %% @doc Create a coverage plan with at least one slice per partition,
  %%      originally designed for parallel extraction of data via 2i.
  -spec create_subpartition_plan('all'|'allup',
                                 pos_integer(),
                                 pos_integer(),
                                 pos_integer(),
                                 req_id(), atom()) ->
                                        {error, term()} | subp_plan().
  create_subpartition_plan(VNodeTarget, NVal, Count, PVC, ReqId, Service) ->
      %% IMPORTANT: `Count' is assumed to be a power of 2 as determined
      %% by `riak_client'. Anything else will behave badly.
      {ok, ChashBin} = riak_core_ring_manager:get_chash_bin(),
      create_subpartition_plan(VNodeTarget, NVal, Count, PVC, ReqId, Service,
                               ChashBin, ?AVAIL_NODE_FUN).
  
  
  %% @doc Create a "mini" traditional coverage plan to replace
  %%      components of a previously-generated plan that are not useful
  %%      to the client because the node is unavailable
  -spec replace_subpartition_chunk(VnodeIdx :: index(),
                                   Node :: node(),
                                   {Mask :: non_neg_integer(),
  