cuckoo table: return estimated size - 1

Summary:
This is to avoid cutting file prematurely and resulting file size to be
half of specified.

Test Plan: db_bench

Reviewers: sdong, yhchiang, igor

Reviewed By: igor

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23541
This commit is contained in:
Lei Jin 2014-09-17 13:25:29 -07:00
parent a062e1f2c4
commit 5600c8f6e5
1 changed files with 1 additions and 1 deletions

View File

@ -323,7 +323,7 @@ uint64_t CuckooTableBuilder::FileSize() const {
expected_hash_table_size *= 2;
}
return (kvs_[0].first.size() + kvs_[0].second.size()) *
expected_hash_table_size;
expected_hash_table_size - 1;
}
// This method is invoked when there is no place to insert the target key.