Skip to content

Commit

Permalink
No prefix iterator in db_stress
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igorcanadi committed Mar 17, 2014
1 parent c61c983 commit 9b8a2b5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/db_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 <=
Expand All @@ -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();
Expand Down

0 comments on commit 9b8a2b5

Please sign in to comment.