'Given a list of putters, return a dict where the key is the putter
and the value is the frag index to use.
This is done so that we line up handoffs using the same frag index
(in the primary part list) as the primary that the handoff is standing
in for.  This lets erasure-code fragment archives wind up on the
preferred local primary nodes when possible.
:param putters: a list of swift.proxy.controllers.obj.MIMEPutter
instance
:param policy: A policy instance which should be one of ECStoragePolicy'

def _determine_chunk_destinations(self, putters, policy):

    handoff_conns = []
    putter_to_frag_index = {}
    for p in putters:
        if (p.node_index is not None):
            putter_to_frag_index[p] = policy.get_backend_index(p.node_index)
        else:
            handoff_conns.append(p)
    available_indexes = putter_to_frag_index.values()
    lack_list = collections.defaultdict(list)
    for frag_index in range(policy.ec_n_unique_fragments):
        available_count = available_indexes.count(frag_index)
        lack = (policy.ec_duplication_factor - available_count)
        for lack_tier in range(lack):
            lack_list[lack_tier].append(frag_index)
    holes = []
    for (lack_tier, indexes) in sorted(lack_list.items(), reverse=True):
        holes.extend(indexes)
    for (hole, p) in zip(holes, handoff_conns):
        putter_to_frag_index[p] = hole
    return putter_to_frag_index
