No prefix iterator in db_stress

Summary: We're trying to deprecate prefix iterators, so no need to test them in db_stress

Test Plan: ran it

Reviewers: ljin

Reviewed By: ljin

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16917
main
Igor Canadi 11 years ago
parent c61c9830d4
commit 9b8a2b52d4
  1. 11
      tools/db_stress.cc

@ -952,10 +952,10 @@ class StressTest {
prefixes[i].resize(FLAGS_prefix_size);
prefix_slices[i] = Slice(prefixes[i]);
readoptionscopy[i] = readoptions;
readoptionscopy[i].prefix = &prefix_slices[i];
readoptionscopy[i].prefix_seek = true;
readoptionscopy[i].snapshot = snapshot;
iters[i] = db_->NewIterator(readoptionscopy[i]);
iters[i]->SeekToFirst();
iters[i]->Seek(prefix_slices[i]);
}
int count = 0;
@ -1103,11 +1103,11 @@ class StressTest {
// prefix
if (!FLAGS_test_batches_snapshots) {
Slice prefix = Slice(key.data(), FLAGS_prefix_size);
read_opts.prefix = &prefix;
read_opts.prefix_seek = true;
Iterator* iter = db_->NewIterator(read_opts);
int64_t count = 0;
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
assert(iter->key().starts_with(prefix));
for (iter->Seek(prefix);
iter->Valid() && iter->key().starts_with(prefix); iter->Next()) {
++count;
}
assert(count <=
@ -1121,7 +1121,6 @@ class StressTest {
} else {
MultiPrefixScan(thread, read_opts, key);
}
read_opts.prefix = nullptr;
} else if (prefixBound <= prob_op && prob_op < writeBound) {
// OPERATION write
uint32_t value_base = thread->rand.Next();

Loading…
Cancel
Save