Skip to content

Commit

Permalink
Add more black-box tests for PlainTable and explicitly support total …
Browse files Browse the repository at this point in the history
…order mode

Summary:
1. Add some more implementation-aware tests for PlainTable
2. move from a hard-coded one index per 16 rows in one prefix to a configurable number. Also, make hash table ratio = 0  means binary search only. Also fixes some divide 0 risks.
3. Explicitly support total order (only use binary search)
4. some code cleaning up.

Test Plan: make all check

Reviewers: haobo, kailiu

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16023
  • Loading branch information
siying committed Feb 13, 2014
1 parent e6b3e3b commit f3ae3d0
Show file tree
Hide file tree
Showing 8 changed files with 805 additions and 192 deletions.
5 changes: 4 additions & 1 deletion db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,10 @@ Iterator* DBImpl::NewInternalIterator(const ReadOptions& options,

Iterator* DBImpl::TEST_NewInternalIterator() {
SequenceNumber ignored;
return NewInternalIterator(ReadOptions(), &ignored);
ReadOptions read_options;
// Use prefix_seek to make the test function more useful.
read_options.prefix_seek = true;
return NewInternalIterator(read_options, &ignored);
}

std::pair<Iterator*, Iterator*> DBImpl::GetTailingIteratorPair(
Expand Down
Loading

0 comments on commit f3ae3d0

Please sign in to comment.