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
main
sdong 8 years ago
parent 42ac9c5f1e
commit d78a4401b5
  1. 4
      db/db_impl.cc
  2. 2
      db/db_impl.h

@ -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) {

@ -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

Loading…
Cancel
Save