Skip to content

Commit

Permalink
DBImpl::GetWalPreallocateBlockSize() should return size_t
Browse files Browse the repository at this point in the history
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
  • Loading branch information
siying committed Sep 19, 2016
1 parent 42ac9c5 commit d78a440
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3682,8 +3682,8 @@ bool DBImpl::MCOverlap(ManualCompaction* m, ManualCompaction* m1) {
return true;
}

uint64_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const {
uint64_t bsize = write_buffer_size / 10 + write_buffer_size;
size_t DBImpl::GetWalPreallocateBlockSize(uint64_t write_buffer_size) const {
size_t bsize = write_buffer_size / 10 + write_buffer_size;
// Some users might set very high write_buffer_size and rely on
// max_total_wal_size or other parameters to control the WAL size.
if (db_options_.max_total_wal_size > 0) {
Expand Down
2 changes: 1 addition & 1 deletion db/db_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ class DBImpl : public DB {
bool HaveManualCompaction(ColumnFamilyData* cfd);
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
Expand Down

0 comments on commit d78a440

Please sign in to comment.