Re-use RocksDB iterators for scans
This commit is contained in:
parent
01e7b5356e
commit
90060ac29f
|
@ -257,7 +257,11 @@ struct RocksDBKeyValueStore : IKeyValueStore {
|
||||||
virtual double getTimeEstimate() { return SERVER_KNOBS->READ_RANGE_TIME_ESTIMATE; }
|
virtual double getTimeEstimate() { return SERVER_KNOBS->READ_RANGE_TIME_ESTIMATE; }
|
||||||
};
|
};
|
||||||
void action(ReadRangeAction& a) {
|
void action(ReadRangeAction& a) {
|
||||||
auto cursor = std::unique_ptr<rocksdb::Iterator>(db->NewIterator(readOptions));
|
if (cursor == nullptr) {
|
||||||
|
cursor = std::unique_ptr<rocksdb::Iterator>(db->NewIterator(readOptions));
|
||||||
|
} else {
|
||||||
|
cursor->Refresh();
|
||||||
|
}
|
||||||
Standalone<RangeResultRef> result;
|
Standalone<RangeResultRef> result;
|
||||||
int accumulatedBytes = 0;
|
int accumulatedBytes = 0;
|
||||||
if (a.rowLimit >= 0) {
|
if (a.rowLimit >= 0) {
|
||||||
|
|
Loading…
Reference in New Issue