* For each local descriptor, we try to find a matching remote one. If so, we will synchronize all events that
* the remote does not have. If we do not find a matching one at all, we send the complete local log.
*/
List<Descriptor> result = new ArrayList<Descriptor>();
for (Descriptor s : source) {
Descriptor diffs = s;
for (Descriptor d : destination) {
if ((s.getStoreID() == d.getStoreID()) && (s.getTargetID().equals(d.getTargetID()))) {
SortedRangeSet rangeDiff = d.getRangeSet().diffDest(s.getRangeSet());
if (!isEmptyRangeSet(rangeDiff)) {
diffs = new Descriptor(s.getTargetID(), s.getStoreID(), rangeDiff);
}
else {
diffs = null;
}
}