this.partitioner = partitioner;
}
public List<Row> resolve(Collection<Message> responses) throws DigestMismatchException, IOException
{
CollatingIterator collator = new CollatingIterator(new Comparator<Pair<Row,InetAddress>>()
{
public int compare(Pair<Row,InetAddress> o1, Pair<Row,InetAddress> o2)
{
return partitioner.getToken(o1.left.key).compareTo(partitioner.getToken(o2.left.key));
}
});
int n = 0;
for (Message response : responses)
{
RangeSliceReply reply = RangeSliceReply.read(response.getMessageBody());
n = Math.max(n, reply.rows.size());
collator.addIterator(new RowIterator(reply.rows.iterator(), response.getFrom()));
}
// for each row, compute the combination of all different versions seen, and repair incomplete versions
ReducingIterator<Pair<Row,InetAddress>, Row> iter = new ReducingIterator<Pair<Row,InetAddress>, Row>(collator)
{