From 5600c8f6e55e677053b87b67b92e6b80aa1cabb4 Mon Sep 17 00:00:00 2001 From: Lei Jin Date: Wed, 17 Sep 2014 13:25:29 -0700 Subject: [PATCH] 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 --- table/cuckoo_table_builder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/cuckoo_table_builder.cc b/table/cuckoo_table_builder.cc index e107071f2..1cf19e3aa 100644 --- a/table/cuckoo_table_builder.cc +++ b/table/cuckoo_table_builder.cc @@ -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. -- GitLab