struct BackfillInterval {
// info about a backfill interval on a peer
eversion_t version; /// version at which the scan occurred
- map<hobject_t,eversion_t, hobject_t::BitwiseComparator> objects;
+ map<hobject_t,eversion_t,hobject_t::Comparator> objects;
+ bool sort_bitwise;
hobject_t begin;
hobject_t end;
+
+ BackfillInterval(bool bitwise=true)
+ : objects(hobject_t::Comparator(bitwise)),
+ sort_bitwise(bitwise)
+ {}
/// clear content
- void clear() {
- *this = BackfillInterval();
+ void clear(bool bitwise=true) {
+ *this = BackfillInterval(bitwise);
}
- void reset(hobject_t start) {
- clear();
+ void reset(hobject_t start, bool bitwise) {
+ clear(bitwise);
begin = end = start;
}
}
/// removes items <= soid and adjusts begin to the first object
- void trim_to(const hobject_t &soid, bool sort_bitwise) {
+ void trim_to(const hobject_t &soid) {
trim();
while (!objects.empty() &&
cmp(objects.begin()->first, soid, sort_bitwise) <= 0) {
f->dump_stream("begin") << begin;
f->dump_stream("end") << end;
f->open_array_section("objects");
- for (map<hobject_t, eversion_t, hobject_t::BitwiseComparator>::const_iterator i = objects.begin();
+ for (map<hobject_t, eversion_t, hobject_t::Comparator>::const_iterator i =
+ objects.begin();
i != objects.end();
++i) {
f->open_object_section("object");
// on_activate() was called prior to getting here
assert(last_backfill_started == earliest_backfill());
new_backfill = false;
+
+ // initialize BackfillIntervals (with proper sort order)
for (set<pg_shard_t>::iterator i = backfill_targets.begin();
i != backfill_targets.end();
++i) {
- peer_backfill_info[*i].reset(peer_info[*i].last_backfill);
+ peer_backfill_info[*i].reset(peer_info[*i].last_backfill,
+ get_sort_bitwise());
}
- backfill_info.reset(last_backfill_started);
+ backfill_info.reset(last_backfill_started,
+ get_sort_bitwise());
}
for (set<pg_shard_t>::iterator i = backfill_targets.begin();
++i) {
peer_backfill_info[*i].trim_to(
MAX_HOBJ(peer_info[*i].last_backfill, last_backfill_started,
- get_sort_bitwise()),
- get_sort_bitwise());
+ get_sort_bitwise()));
}
- backfill_info.trim_to(last_backfill_started, get_sort_bitwise());
+ backfill_info.trim_to(last_backfill_started);
hobject_t backfill_pos = MIN_HOBJ(backfill_info.begin,
earliest_peer_backfill(),