DBImpl::GetWalPreallocateBlockSize() should return size_t

Summary: WritableFile::SetPreallocationBlockSize() requires parameter as size_t, and options used in DBImpl::GetWalPreallocateBlockSize() are all size_t. WritableFile::SetPreallocationBlockSize() should return size_t to avoid build break if size_t is not uint64_t.

Test Plan: Run existing tests.

Reviewers: andrewkr, IslamAbdelRahman, yiwu

Reviewed By: yiwu

Subscribers: leveldb, andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D64137
This commit is contained in:
sdong 2016-09-19 16:21:35 -07:00
parent 42ac9c5f1e
commit d78a4401b5
2 changed files with 3 additions and 3 deletions

View File

@ -3682,8 +3682,8 @@ bool DBImpl::MCOverlap(ManualCompaction* m, ManualCompaction* m1) {
return true; return true;
} }
uint64_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const { size_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const {
uint64_t bsize = write_buffer_size / 10 + write_buffer_size; size_t bsize = write_buffer_size / 10 + write_buffer_size;
// Some users might set very high write_buffer_size and rely on // Some users might set very high write_buffer_size and rely on
// max_total_wal_size or other parameters to control the WAL size. // max_total_wal_size or other parameters to control the WAL size.
if (db_options_.max_total_wal_size > 0) { if (db_options_.max_total_wal_size > 0) {

View File

@ -1068,7 +1068,7 @@ class DBImpl : public DB {
bool HaveManualCompaction(ColumnFamilyData* cfd); bool HaveManualCompaction(ColumnFamilyData* cfd);
bool MCOverlap(ManualCompaction* m, ManualCompaction* m1); bool MCOverlap(ManualCompaction* m, ManualCompaction* m1);
uint64_t GetWalPreallocateBlockSize(uint64_t write_buffer_size) const; size_t GetWalPreallocateBlockSize(uint64_t write_buffer_size) const;
}; };
// Sanitize db options. The caller should delete result.info_log if // Sanitize db options. The caller should delete result.info_log if