return generic_iter->status();
}
};
+protected:
+ Iterator make_iterator(const std::string &prefix, WholeSpaceIterator w_iter) {
+ return std::make_shared<PrefixIteratorImpl>(
+ prefix,
+ w_iter);
+ }
public:
typedef uint32_t IteratorOpts;
static const uint32_t ITERATOR_NOCACHE = 1;
virtual WholeSpaceIterator get_wholespace_iterator(IteratorOpts opts = 0) = 0;
virtual Iterator get_iterator(const std::string &prefix, IteratorOpts opts = 0, IteratorBounds bounds = IteratorBounds()) {
- return std::make_shared<PrefixIteratorImpl>(
- prefix,
+ return make_iterator(prefix,
get_wholespace_iterator(opts));
}
std::move(bounds));
}
} else {
- return KeyValueDB::get_iterator(prefix, opts);
+ // use wholespace engine if no cfs are configured
+ // or use default cf otherwise as there is no
+ // matching cf for the specified prefix.
+ auto w_it = cf_handles.size() == 0 || prefix.empty() ?
+ get_wholespace_iterator(opts) :
+ get_default_cf_iterator();
+ return KeyValueDB::make_iterator(prefix, w_it);
}
}