Skip to content

Commit

Permalink
cuckoo table: return estimated size - 1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Lei Jin committed Sep 17, 2014
1 parent a062e1f commit 5600c8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion table/cuckoo_table_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5600c8f

Please sign in to comment.