int originalCount = hcrr.size();
hcrr.addAll(hcrr.subList(0, recordsPerRecordSet - 1));
/* Pick overlapping slices across the pseudo-ring */
for (int i = 0; i < originalCount; i++) {
AnswerSet answer = new AnswerSet();
answer.addAll(hcrr.subList(i, i + recordsPerRecordSet));
rrs.addAll(answer.toResourceRecordSets(hostedZoneId, name, type, ttl));
}
return rrs;
}
/*
* We have <= recordsPerRecordSet records. Add an answer with all of
* them, and secondary answers covering each record failure.
*/
AnswerSet answer = new AnswerSet();
answer.addAll(hcrr);
rrs.addAll(answer.toResourceRecordSets(hostedZoneId, name, type, ttl));
for (List<HealthCheckedResourceRecord> fragment : new IterableSubListGenerator<HealthCheckedResourceRecord>(
records, recordsPerRecordSet - 1)) {
answer = new AnswerSet();
answer.addAll(fragment);
rrs.addAll(answer.toResourceRecordSets(hostedZoneId, name, type, ttl));
rrs.get(rrs.size() - 1).setWeight(0L);
}
return rrs;
}