Fix all the lint errors.

Summary:
Scripted and removed all trailing spaces and converted all tabs to
spaces.

Also fixed other lint errors.
All lint errors from this point of time should be taken seriously.

Test Plan: make all check

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D7059
main
Abhishek Kona 12 years ago
parent 9b838535d1
commit d29f181923
  1. 28
      db/c.cc
  2. 14
      db/db_bench.cc
  3. 14
      db/db_filesnapshot.cc
  4. 26
      db/db_impl.cc
  5. 2
      db/db_impl.h
  6. 8
      db/db_test.cc
  7. 2
      db/memtable.cc
  8. 2
      db/memtable.h
  9. 16
      db/memtablelist.cc
  10. 10
      db/memtablelist.h
  11. 6
      db/version_edit.h
  12. 50
      db/version_set.cc
  13. 10
      db/version_set.h
  14. 16
      include/leveldb/options.h
  15. 2
      include/leveldb/table_builder.h
  16. 2
      util/bloom.cc
  17. 2
      util/crc32c.cc
  18. 20
      util/env_hdfs.cc
  19. 6
      util/env_posix.cc
  20. 2
      util/options.cc

@ -445,7 +445,7 @@ void leveldb_options_set_block_restart_interval(leveldb_options_t* opt, int n) {
} }
void leveldb_options_set_target_file_size_base( void leveldb_options_set_target_file_size_base(
leveldb_options_t* opt, uint64_t n) { leveldb_options_t* opt, uint64_t n) {
opt->rep.target_file_size_base = n; opt->rep.target_file_size_base = n;
} }
@ -455,47 +455,47 @@ void leveldb_options_set_target_file_size_multiplier(
} }
void leveldb_options_set_max_bytes_for_level_base( void leveldb_options_set_max_bytes_for_level_base(
leveldb_options_t* opt, uint64_t n) { leveldb_options_t* opt, uint64_t n) {
opt->rep.max_bytes_for_level_base = n; opt->rep.max_bytes_for_level_base = n;
} }
void leveldb_options_set_max_bytes_for_level_multiplier( void leveldb_options_set_max_bytes_for_level_multiplier(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.max_bytes_for_level_multiplier = n; opt->rep.max_bytes_for_level_multiplier = n;
} }
void leveldb_options_set_expanded_compaction_factor( void leveldb_options_set_expanded_compaction_factor(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.expanded_compaction_factor = n; opt->rep.expanded_compaction_factor = n;
} }
void leveldb_options_set_max_grandparent_overlap_factor( void leveldb_options_set_max_grandparent_overlap_factor(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.max_grandparent_overlap_factor = n; opt->rep.max_grandparent_overlap_factor = n;
} }
void leveldb_options_set_num_levels(leveldb_options_t* opt, int n) { void leveldb_options_set_num_levels(leveldb_options_t* opt, int n) {
opt->rep.num_levels = n; opt->rep.num_levels = n;
} }
void leveldb_options_set_level0_file_num_compaction_trigger( void leveldb_options_set_level0_file_num_compaction_trigger(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.level0_file_num_compaction_trigger = n; opt->rep.level0_file_num_compaction_trigger = n;
} }
void leveldb_options_set_level0_slowdown_writes_trigger( void leveldb_options_set_level0_slowdown_writes_trigger(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.level0_slowdown_writes_trigger = n; opt->rep.level0_slowdown_writes_trigger = n;
} }
void leveldb_options_set_level0_stop_writes_trigger( void leveldb_options_set_level0_stop_writes_trigger(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.level0_stop_writes_trigger = n; opt->rep.level0_stop_writes_trigger = n;
} }
void leveldb_options_set_max_mem_compaction_level( void leveldb_options_set_max_mem_compaction_level(
leveldb_options_t* opt, int n) { leveldb_options_t* opt, int n) {
opt->rep.max_mem_compaction_level = n; opt->rep.max_mem_compaction_level = n;
} }
void leveldb_options_set_compression(leveldb_options_t* opt, int t) { void leveldb_options_set_compression(leveldb_options_t* opt, int t) {

@ -87,7 +87,7 @@ static bool FLAGS_histogram = false;
// (initialized to default value by "main") // (initialized to default value by "main")
static int FLAGS_write_buffer_size = 0; static int FLAGS_write_buffer_size = 0;
// The number of in-memory memtables. // The number of in-memory memtables.
// Each memtable is of size FLAGS_write_buffer_size. // Each memtable is of size FLAGS_write_buffer_size.
// This is initialized to default value of 2 in "main" function. // This is initialized to default value of 2 in "main" function.
static int FLAGS_max_write_buffer_number = 0; static int FLAGS_max_write_buffer_number = 0;
@ -452,7 +452,7 @@ struct ThreadState {
Stats stats; Stats stats;
SharedState* shared; SharedState* shared;
ThreadState(int index) /* implicit */ ThreadState(int index)
: tid(index), : tid(index),
rand(1000 + index) { rand(1000 + index) {
} }
@ -979,7 +979,7 @@ class Benchmark {
FLAGS_delete_obsolete_files_period_micros; FLAGS_delete_obsolete_files_period_micros;
options.rate_limit = FLAGS_rate_limit; options.rate_limit = FLAGS_rate_limit;
options.table_cache_numshardbits = FLAGS_table_cache_numshardbits; options.table_cache_numshardbits = FLAGS_table_cache_numshardbits;
options.max_grandparent_overlap_factor = options.max_grandparent_overlap_factor =
FLAGS_max_grandparent_overlap_factor; FLAGS_max_grandparent_overlap_factor;
options.disable_auto_compactions = FLAGS_disable_auto_compactions; options.disable_auto_compactions = FLAGS_disable_auto_compactions;
options.source_compaction_factor = FLAGS_source_compaction_factor; options.source_compaction_factor = FLAGS_source_compaction_factor;
@ -1272,7 +1272,7 @@ int main(int argc, char** argv) {
FLAGS_write_buffer_size = leveldb::Options().write_buffer_size; FLAGS_write_buffer_size = leveldb::Options().write_buffer_size;
FLAGS_max_write_buffer_number = leveldb::Options().max_write_buffer_number; FLAGS_max_write_buffer_number = leveldb::Options().max_write_buffer_number;
FLAGS_open_files = leveldb::Options().max_open_files; FLAGS_open_files = leveldb::Options().max_open_files;
FLAGS_max_background_compactions = FLAGS_max_background_compactions =
leveldb::Options().max_background_compactions; leveldb::Options().max_background_compactions;
// Compression test code above refers to FLAGS_block_size // Compression test code above refers to FLAGS_block_size
FLAGS_block_size = leveldb::Options().block_size; FLAGS_block_size = leveldb::Options().block_size;
@ -1320,7 +1320,7 @@ int main(int argc, char** argv) {
exit(1); exit(1);
} }
} else if (sscanf(argv[i], "--table_cache_numshardbits=%d%c", } else if (sscanf(argv[i], "--table_cache_numshardbits=%d%c",
&n, &junk) == 1) { &n, &junk) == 1) {
if (n <= 0 || n > 20) { if (n <= 0 || n > 20) {
fprintf(stderr, "The cache cannot be sharded into 2**%d pieces\n", n); fprintf(stderr, "The cache cannot be sharded into 2**%d pieces\n", n);
exit(1); exit(1);
@ -1433,10 +1433,10 @@ int main(int argc, char** argv) {
} else if (sscanf(argv[i], "--max_grandparent_overlap_factor=%d%c", } else if (sscanf(argv[i], "--max_grandparent_overlap_factor=%d%c",
&n, &junk) == 1) { &n, &junk) == 1) {
FLAGS_max_grandparent_overlap_factor = n; FLAGS_max_grandparent_overlap_factor = n;
} else if (sscanf(argv[i], "--disable_auto_compactions=%d%c", } else if (sscanf(argv[i], "--disable_auto_compactions=%d%c",
&n, &junk) == 1 && (n == 0 || n ==1)) { &n, &junk) == 1 && (n == 0 || n ==1)) {
FLAGS_disable_auto_compactions = n; FLAGS_disable_auto_compactions = n;
} else if (sscanf(argv[i], "--source_compaction_factor=%d%c", } else if (sscanf(argv[i], "--source_compaction_factor=%d%c",
&n, &junk) == 1 && n > 0) { &n, &junk) == 1 && n > 0) {
FLAGS_source_compaction_factor = n; FLAGS_source_compaction_factor = n;
} else { } else {

@ -1,6 +1,6 @@
// Copyright (c) 2012 Facebook. // Copyright (c) 2012 Facebook.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "db/db_impl.h" #include "db/db_impl.h"
#include "db/filename.h" #include "db/filename.h"
@ -16,17 +16,17 @@ namespace leveldb {
Status DBImpl::DisableFileDeletions() { Status DBImpl::DisableFileDeletions() {
MutexLock l(&mutex_); MutexLock l(&mutex_);
disable_delete_obsolete_files_ = true; disable_delete_obsolete_files_ = true;
return Status::OK(); return Status::OK();
} }
Status DBImpl::EnableFileDeletions() { Status DBImpl::EnableFileDeletions() {
MutexLock l(&mutex_); MutexLock l(&mutex_);
disable_delete_obsolete_files_ = false; disable_delete_obsolete_files_ = false;
return Status::OK(); return Status::OK();
} }
Status DBImpl::GetLiveFiles(std::vector<std::string>& ret, Status DBImpl::GetLiveFiles(std::vector<std::string>& ret,
uint64_t* manifest_file_size) { uint64_t* manifest_file_size) {
*manifest_file_size = 0; *manifest_file_size = 0;
@ -34,7 +34,7 @@ Status DBImpl::GetLiveFiles(std::vector<std::string>& ret,
// flush all dirty data to disk. // flush all dirty data to disk.
Status status = Flush(FlushOptions()); Status status = Flush(FlushOptions());
if (!status.ok()) { if (!status.ok()) {
Log(options_.info_log, "Cannot Flush data %s\n", Log(options_.info_log, "Cannot Flush data %s\n",
status.ToString().c_str()); status.ToString().c_str());
return status; return status;
} }
@ -42,7 +42,7 @@ Status DBImpl::GetLiveFiles(std::vector<std::string>& ret,
MutexLock l(&mutex_); MutexLock l(&mutex_);
// Make a set of all of the live *.sst files // Make a set of all of the live *.sst files
std::set<uint64_t> live; std::set<uint64_t> live;
versions_->AddLiveFilesCurrentVersion(&live); versions_->AddLiveFilesCurrentVersion(&live);
ret.resize(live.size() + 2); //*.sst + CURRENT + MANIFEST ret.resize(live.size() + 2); //*.sst + CURRENT + MANIFEST
@ -55,7 +55,7 @@ Status DBImpl::GetLiveFiles(std::vector<std::string>& ret,
} }
ret[live.size()] = CurrentFileName(""); ret[live.size()] = CurrentFileName("");
ret[live.size()+1] = DescriptorFileName("", ret[live.size()+1] = DescriptorFileName("",
versions_->ManifestFileNumber()); versions_->ManifestFileNumber());
// find length of manifest file while holding the mutex lock // find length of manifest file while holding the mutex lock

@ -265,7 +265,7 @@ DBImpl::~DBImpl() {
delete logger_; delete logger_;
} }
// Do not flush and close database elegantly. Simulate a crash. // Do not flush and close database elegantly. Simulate a crash.
void DBImpl::TEST_Destroy_DBImpl() { void DBImpl::TEST_Destroy_DBImpl() {
// ensure that no new memtable flushes can occur // ensure that no new memtable flushes can occur
flush_on_destroy_ = false; flush_on_destroy_ = false;
@ -718,7 +718,7 @@ Status DBImpl::WriteLevel0Table(MemTable* mem, VersionEdit* edit,
// created file might not be considered as a live-file by another // created file might not be considered as a live-file by another
// compaction thread that is concurrently deleting obselete files. // compaction thread that is concurrently deleting obselete files.
// The pending_outputs can be cleared only after the new version is // The pending_outputs can be cleared only after the new version is
// committed so that other threads can recognize this file as a // committed so that other threads can recognize this file as a
// valid one. // valid one.
// pending_outputs_.erase(meta.number); // pending_outputs_.erase(meta.number);
@ -778,7 +778,7 @@ Status DBImpl::CompactMemTable(bool* madeProgress) {
} }
// Replace immutable memtable with the generated Table // Replace immutable memtable with the generated Table
s = imm_.InstallMemtableFlushResults(m, versions_, s, &mutex_, s = imm_.InstallMemtableFlushResults(m, versions_, s, &mutex_,
options_.info_log, file_number, pending_outputs_); options_.info_log, file_number, pending_outputs_);
if (s.ok()) { if (s.ok()) {
@ -851,10 +851,10 @@ void DBImpl::TEST_CompactRange(int level, const Slice* begin,const Slice* end) {
MutexLock l(&mutex_); MutexLock l(&mutex_);
// When a manual compaction arrives, temporarily throttle down // When a manual compaction arrives, temporarily throttle down
// the number of background compaction threads to 1. This is // the number of background compaction threads to 1. This is
// needed to ensure that this manual compaction can compact // needed to ensure that this manual compaction can compact
// any range of keys/files. We artificialy increase // any range of keys/files. We artificialy increase
// bg_compaction_scheduled_ by a large number, this causes // bg_compaction_scheduled_ by a large number, this causes
// the system to have a single background thread. Now, // the system to have a single background thread. Now,
// this manual compaction can progress without stomping // this manual compaction can progress without stomping
@ -987,7 +987,7 @@ void DBImpl::BackgroundCall() {
MaybeScheduleLogDBDeployStats(); MaybeScheduleLogDBDeployStats();
// Previous compaction may have produced too many files in a level, // Previous compaction may have produced too many files in a level,
// So reschedule another compaction if we made progress in the // So reschedule another compaction if we made progress in the
// last compaction. // last compaction.
if (madeProgress) { if (madeProgress) {
MaybeScheduleCompaction(); MaybeScheduleCompaction();
@ -995,13 +995,13 @@ void DBImpl::BackgroundCall() {
bg_cv_.SignalAll(); bg_cv_.SignalAll();
} }
Status DBImpl::BackgroundCompaction(bool* madeProgress, Status DBImpl::BackgroundCompaction(bool* madeProgress,
DeletionState& deletion_state) { DeletionState& deletion_state) {
*madeProgress = false; *madeProgress = false;
mutex_.AssertHeld(); mutex_.AssertHeld();
while (imm_.IsFlushPending()) { while (imm_.IsFlushPending()) {
Log(options_.info_log, Log(options_.info_log,
"BackgroundCompaction doing CompactMemTable, compaction slots available %d", "BackgroundCompaction doing CompactMemTable, compaction slots available %d",
options_.max_background_compactions - bg_compaction_scheduled_); options_.max_background_compactions - bg_compaction_scheduled_);
Status stat = CompactMemTable(madeProgress); Status stat = CompactMemTable(madeProgress);
@ -1129,7 +1129,7 @@ void DBImpl::AllocateCompactionOutputFileNumbers(CompactionState* compact) {
// Frees up unused file number. // Frees up unused file number.
void DBImpl::ReleaseCompactionUnusedFileNumbers(CompactionState* compact) { void DBImpl::ReleaseCompactionUnusedFileNumbers(CompactionState* compact) {
mutex_.AssertHeld(); mutex_.AssertHeld();
for (std::list<uint64_t>::iterator it = for (std::list<uint64_t>::iterator it =
compact->allocated_file_numbers.begin(); compact->allocated_file_numbers.begin();
it != compact->allocated_file_numbers.end(); ++it) { it != compact->allocated_file_numbers.end(); ++it) {
uint64_t file_number = *it; uint64_t file_number = *it;
@ -1291,7 +1291,7 @@ inline SequenceNumber DBImpl::findEarliestVisibleSnapshot(
Status DBImpl::DoCompactionWork(CompactionState* compact) { Status DBImpl::DoCompactionWork(CompactionState* compact) {
int64_t imm_micros = 0; // Micros spent doing imm_ compactions int64_t imm_micros = 0; // Micros spent doing imm_ compactions
Log(options_.info_log, Log(options_.info_log,
"Compacting %d@%d + %d@%d files, compaction slots available %d", "Compacting %d@%d + %d@%d files, compaction slots available %d",
compact->compaction->num_input_files(0), compact->compaction->num_input_files(0),
compact->compaction->level(), compact->compaction->level(),
@ -1877,7 +1877,7 @@ Status DBImpl::MakeRoomForWrite(bool force) {
s = env_->NewWritableFile(LogFileName(dbname_, new_log_number), &lfile); s = env_->NewWritableFile(LogFileName(dbname_, new_log_number), &lfile);
if (!s.ok()) { if (!s.ok()) {
// Avoid chewing through file number space in a tight loop. // Avoid chewing through file number space in a tight loop.
versions_->ReuseFileNumber(new_log_number); versions_->ReuseFileNumber(new_log_number);
break; break;
} }
delete log_; delete log_;

@ -158,7 +158,7 @@ protected:
Status InstallCompactionResults(CompactionState* compact); Status InstallCompactionResults(CompactionState* compact);
void AllocateCompactionOutputFileNumbers(CompactionState* compact); void AllocateCompactionOutputFileNumbers(CompactionState* compact);
void ReleaseCompactionUnusedFileNumbers(CompactionState* compact); void ReleaseCompactionUnusedFileNumbers(CompactionState* compact);
// Returns the list of live files in 'live' and the list // Returns the list of live files in 'live' and the list
// of all files in the filesystem in 'allfiles'. // of all files in the filesystem in 'allfiles'.

@ -1703,7 +1703,7 @@ TEST(DBTest, DeletionMarkers2) {
TEST(DBTest, OverlapInLevel0) { TEST(DBTest, OverlapInLevel0) {
do { do {
int tmp = dbfull()->MaxMemCompactionLevel(); int tmp = dbfull()->MaxMemCompactionLevel();
ASSERT_EQ(tmp, 2) << "Fix test to match config"; ASSERT_EQ(tmp, 2) << "Fix test to match config";
// Fill levels 1 and 2 to disable the pushing of new memtables to levels > 0. // Fill levels 1 and 2 to disable the pushing of new memtables to levels > 0.
@ -2429,17 +2429,17 @@ class ModelDB: public DB {
virtual int NumberLevels() virtual int NumberLevels()
{ {
return 1; return 1;
} }
virtual int MaxMemCompactionLevel() virtual int MaxMemCompactionLevel()
{ {
return 1; return 1;
} }
virtual int Level0StopWriteTrigger() virtual int Level0StopWriteTrigger()
{ {
return -1; return -1;
} }
virtual Status Flush(const leveldb::FlushOptions& options) { virtual Status Flush(const leveldb::FlushOptions& options) {

@ -24,7 +24,7 @@ MemTable::MemTable(const InternalKeyComparator& cmp, int numlevel)
table_(comparator_, &arena_), table_(comparator_, &arena_),
flush_in_progress_(false), flush_in_progress_(false),
flush_completed_(false), flush_completed_(false),
file_number_(0), file_number_(0),
edit_(numlevel) { edit_(numlevel) {
} }

@ -88,7 +88,7 @@ class MemTable {
Table table_; Table table_;
// These are used to manage memtable flushes to storage // These are used to manage memtable flushes to storage
bool flush_in_progress_; // started the flush bool flush_in_progress_; // started the flush
bool flush_completed_; // finished the flush bool flush_completed_; // finished the flush
uint64_t file_number_; // filled up after flush is complete uint64_t file_number_; // filled up after flush is complete

@ -1,9 +1,11 @@
// Copyright (c) 2012 Facebook. // Copyright (c) 2012 Facebook.
#include "db/memtablelist.h"
#include <string> #include <string>
#include "leveldb/db.h" #include "leveldb/db.h"
#include "db/memtable.h" #include "db/memtable.h"
#include "db/memtablelist.h"
#include "leveldb/env.h" #include "leveldb/env.h"
#include "leveldb/iterator.h" #include "leveldb/iterator.h"
#include "util/coding.h" #include "util/coding.h"
@ -57,7 +59,7 @@ MemTable* MemTableList::PickMemtableToFlush() {
MemTable* m = *it; MemTable* m = *it;
if (!m->flush_in_progress_) { if (!m->flush_in_progress_) {
assert(!m->flush_completed_); assert(!m->flush_completed_);
num_flush_not_started_--; num_flush_not_started_--;
if (num_flush_not_started_ == 0) { if (num_flush_not_started_ == 0) {
imm_flush_needed.Release_Store(NULL); imm_flush_needed.Release_Store(NULL);
} }
@ -110,11 +112,11 @@ Status MemTableList::InstallMemtableFlushResults(MemTable* m,
if (!m->flush_completed_) { if (!m->flush_completed_) {
break; break;
} }
Log(info_log, Log(info_log,
"Level-0 commit table #%llu: started", "Level-0 commit table #%llu: started",
(unsigned long long)m->file_number_); (unsigned long long)m->file_number_);
// this can release and reacquire the mutex. // this can release and reacquire the mutex.
s = vset->LogAndApply(&m->edit_, mu); s = vset->LogAndApply(&m->edit_, mu);
if (s.ok()) { // commit new state if (s.ok()) { // commit new state
@ -149,11 +151,11 @@ Status MemTableList::InstallMemtableFlushResults(MemTable* m,
return s; return s;
} }
// New memtables are inserted at the front of the list. // New memtables are inserted at the front of the list.
void MemTableList::Add(MemTable* m) { void MemTableList::Add(MemTable* m) {
assert(size_ >= num_flush_not_started_); assert(size_ >= num_flush_not_started_);
size_++; size_++;
memlist_.push_front(m); memlist_.push_front(m);
num_flush_not_started_++; num_flush_not_started_++;
if (num_flush_not_started_ == 1) { if (num_flush_not_started_ == 1) {
imm_flush_needed.Release_Store((void *)1); imm_flush_needed.Release_Store((void *)1);

@ -19,15 +19,15 @@ class MemTableListIterator;
// //
// This class stores refeernces to all the immutable memtables. // This class stores refeernces to all the immutable memtables.
// The memtables are flushed to L0 as soon as possible and in // The memtables are flushed to L0 as soon as possible and in
// any order. If there are more than one immutable memtable, their // any order. If there are more than one immutable memtable, their
// flushes can occur concurrently. However, they are 'committed' // flushes can occur concurrently. However, they are 'committed'
// to the manifest in FIFO order to maintain correctness and // to the manifest in FIFO order to maintain correctness and
// recoverability from a crash. // recoverability from a crash.
// //
class MemTableList { class MemTableList {
public: public:
// A list of memtables. // A list of memtables.
MemTableList() : size_(0), num_flush_not_started_(0), MemTableList() : size_(0), num_flush_not_started_(0),
commit_in_progress_(false) { commit_in_progress_(false) {
imm_flush_needed.Release_Store(NULL); imm_flush_needed.Release_Store(NULL);
@ -62,7 +62,7 @@ class MemTableList {
uint64_t file_number, uint64_t file_number,
std::set<uint64_t>& pending_outputs); std::set<uint64_t>& pending_outputs);
// New memtables are inserted at the front of the list. // New memtables are inserted at the front of the list.
void Add(MemTable* m); void Add(MemTable* m);
// Returns an estimate of the number of bytes of data in use. // Returns an estimate of the number of bytes of data in use.
@ -72,7 +72,7 @@ class MemTableList {
// Return the most recent value found, if any. // Return the most recent value found, if any.
bool Get(const LookupKey& key, std::string* value, Status* s); bool Get(const LookupKey& key, std::string* value, Status* s);
// Returns the list of underlying memtables. // Returns the list of underlying memtables.
void GetMemTables(std::vector<MemTable*>* list); void GetMemTables(std::vector<MemTable*>* list);
// Copying allowed // Copying allowed

@ -29,9 +29,9 @@ struct FileMetaData {
class VersionEdit { class VersionEdit {
public: public:
VersionEdit(int number_levels) : /* implicit */ VersionEdit(int number_levels) :
number_levels_(number_levels) { number_levels_(number_levels) {
Clear(); Clear();
} }
~VersionEdit() { } ~VersionEdit() { }

@ -456,7 +456,7 @@ int Version::PickLevelForMemTableOutput(
} }
// Store in "*inputs" all files in "level" that overlap [begin,end] // Store in "*inputs" all files in "level" that overlap [begin,end]
// If hint_index is specified, then it points to a file in the // If hint_index is specified, then it points to a file in the
// overlapping range. // overlapping range.
// The file_index returns a pointer to any file in an overlapping range. // The file_index returns a pointer to any file in an overlapping range.
void Version::GetOverlappingInputs( void Version::GetOverlappingInputs(
@ -551,7 +551,7 @@ void Version::GetOverlappingInputsBinarySearch(
break; break;
} }
} }
// If there were no overlapping files, return immediately. // If there were no overlapping files, return immediately.
if (!foundOverlap) { if (!foundOverlap) {
return; return;
@ -562,7 +562,7 @@ void Version::GetOverlappingInputsBinarySearch(
} }
ExtendOverlappingInputs(level, user_begin, user_end, inputs, mid); ExtendOverlappingInputs(level, user_begin, user_end, inputs, mid);
} }
// Store in "*inputs" all files in "level" that overlap [begin,end] // Store in "*inputs" all files in "level" that overlap [begin,end]
// The midIndex specifies the index of at least one file that // The midIndex specifies the index of at least one file that
// overlaps the specified range. From that file, iterate backward // overlaps the specified range. From that file, iterate backward
@ -646,8 +646,8 @@ struct VersionSet::ManifestWriter {
bool done; bool done;
port::CondVar cv; port::CondVar cv;
VersionEdit* edit; VersionEdit* edit;
explicit ManifestWriter(port::Mutex* mu, VersionEdit* e) : explicit ManifestWriter(port::Mutex* mu, VersionEdit* e) :
done(false), cv(mu), edit(e) {} done(false), cv(mu), edit(e) {}
}; };
@ -966,7 +966,7 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
if (w.done) { if (w.done) {
return w.status; return w.status;
} }
std::vector<VersionEdit*> batch_edits; std::vector<VersionEdit*> batch_edits;
Version* v = new Version(this, current_version_number_++); Version* v = new Version(this, current_version_number_++);
Builder builder(this, current_); Builder builder(this, current_);
@ -978,7 +978,7 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
std::deque<ManifestWriter*>::iterator iter = manifest_writers_.begin(); std::deque<ManifestWriter*>::iterator iter = manifest_writers_.begin();
for (; iter != manifest_writers_.end(); ++iter) { for (; iter != manifest_writers_.end(); ++iter) {
last_writer = *iter; last_writer = *iter;
LogAndApplyHelper(&builder, v, last_writer->edit, mu); LogAndApplyHelper(&builder, v, last_writer->edit, mu);
batch_edits.push_back(last_writer->edit); batch_edits.push_back(last_writer->edit);
} }
builder.SaveTo(v); builder.SaveTo(v);
@ -1038,7 +1038,7 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
// find offset in manifest file where this version is stored. // find offset in manifest file where this version is stored.
new_manifest_file_size = descriptor_file_->GetFileSize(); new_manifest_file_size = descriptor_file_->GetFileSize();
mu->Lock(); mu->Lock();
} }
@ -1050,7 +1050,7 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
prev_log_number_ = edit->prev_log_number_; prev_log_number_ = edit->prev_log_number_;
} else { } else {
Log(options_->info_log, "Error in committing version %ld", Log(options_->info_log, "Error in committing version %ld",
v->GetVersionNumber()); v->GetVersionNumber());
delete v; delete v;
if (!new_manifest_file.empty()) { if (!new_manifest_file.empty()) {
@ -1279,7 +1279,7 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname,
// Write out each individual edit // Write out each individual edit
if (verbose) { if (verbose) {
printf("*************************Edit[%d] = %s\n", printf("*************************Edit[%d] = %s\n",
count, edit.DebugString().c_str()); count, edit.DebugString().c_str());
} }
count++; count++;
@ -1433,7 +1433,7 @@ void VersionSet::Finalize(Version* v) {
} }
// a static compator used to sort files based on their size // a static compator used to sort files based on their size
static bool compareSize(const VersionSet::Fsize& first, static bool compareSize(const VersionSet::Fsize& first,
const VersionSet::Fsize& second) { const VersionSet::Fsize& second) {
return (first.file->file_size > second.file->file_size); return (first.file->file_size > second.file->file_size);
} }
@ -1690,11 +1690,11 @@ Iterator* VersionSet::MakeInputIterator(Compaction* c) {
} }
double VersionSet::MaxBytesForLevel(int level) { double VersionSet::MaxBytesForLevel(int level) {
// Note: the result for level zero is not really used since we set // Note: the result for level zero is not really used since we set
// the level-0 compaction threshold based on number of files. // the level-0 compaction threshold based on number of files.
assert(level >= 0); assert(level >= 0);
assert(level < NumberLevels()); assert(level < NumberLevels());
return level_max_bytes_[level]; return level_max_bytes_[level];
} }
uint64_t VersionSet::MaxFileSizeForLevel(int level) { uint64_t VersionSet::MaxFileSizeForLevel(int level) {
@ -1715,7 +1715,7 @@ int64_t VersionSet::MaxGrandParentOverlapBytes(int level) {
return result; return result;
} }
// verify that the files listed in this compaction are present // verify that the files listed in this compaction are present
// in the current version // in the current version
bool VersionSet::VerifyCompactionFileConsistency(Compaction* c) { bool VersionSet::VerifyCompactionFileConsistency(Compaction* c) {
if (c->input_version_ != current_) { if (c->input_version_ != current_) {
@ -1774,11 +1774,11 @@ void VersionSet::ReleaseCompactionFiles(Compaction* c, Status status) {
// The total size of files that are currently being compacted // The total size of files that are currently being compacted
uint64_t VersionSet::SizeBeingCompacted(int level) { uint64_t VersionSet::SizeBeingCompacted(int level) {
uint64_t total = 0; uint64_t total = 0;
for (std::set<Compaction*>::iterator it = for (std::set<Compaction*>::iterator it =
compactions_in_progress_[level].begin(); compactions_in_progress_[level].begin();
it != compactions_in_progress_[level].end(); it != compactions_in_progress_[level].end();
++it) { ++it) {
Compaction* c = (*it); Compaction* c = (*it);
assert(c->level() == level); assert(c->level() == level);
for (int i = 0; i < c->num_input_files(0); i++) { for (int i = 0; i < c->num_input_files(0); i++) {
total += c->input(0,i)->file_size; total += c->input(0,i)->file_size;
@ -1838,7 +1838,7 @@ Compaction* VersionSet::PickCompactionBySize(int level) {
// Do not pick this file if its parents at level+1 are being compacted. // Do not pick this file if its parents at level+1 are being compacted.
// Maybe we can avoid redoing this work in SetupOtherInputs // Maybe we can avoid redoing this work in SetupOtherInputs
int parent_index = -1; int parent_index = -1;
if (ParentRangeInCompaction(&f->smallest, &f->largest, level, if (ParentRangeInCompaction(&f->smallest, &f->largest, level,
&parent_index)) { &parent_index)) {
continue; continue;
} }
@ -1887,7 +1887,7 @@ Compaction* VersionSet::PickCompaction() {
if (c == NULL && (current_->file_to_compact_ != NULL)) { if (c == NULL && (current_->file_to_compact_ != NULL)) {
level = current_->file_to_compact_level_; level = current_->file_to_compact_level_;
c = new Compaction(level, MaxFileSizeForLevel(level), c = new Compaction(level, MaxFileSizeForLevel(level),
MaxGrandParentOverlapBytes(level), NumberLevels(), true); MaxGrandParentOverlapBytes(level), NumberLevels(), true);
c->inputs_[0].push_back(current_->file_to_compact_); c->inputs_[0].push_back(current_->file_to_compact_);
} }
@ -1937,7 +1937,7 @@ Compaction* VersionSet::PickCompaction() {
bool VersionSet::ParentRangeInCompaction(const InternalKey* smallest, bool VersionSet::ParentRangeInCompaction(const InternalKey* smallest,
const InternalKey* largest, int level, int* parent_index) { const InternalKey* largest, int level, int* parent_index) {
std::vector<FileMetaData*> inputs; std::vector<FileMetaData*> inputs;
current_->GetOverlappingInputs(level+1, smallest, largest, current_->GetOverlappingInputs(level+1, smallest, largest,
&inputs, *parent_index, parent_index); &inputs, *parent_index, parent_index);
return FilesInCompaction(inputs); return FilesInCompaction(inputs);
@ -1948,7 +1948,7 @@ bool VersionSet::FilesInCompaction(std::vector<FileMetaData*>& files) {
for (unsigned int i = 0; i < files.size(); i++) { for (unsigned int i = 0; i < files.size(); i++) {
if (files[i]->being_compacted) { if (files[i]->being_compacted) {
return true; return true;
} }
} }
return false; return false;
} }
@ -1984,7 +1984,7 @@ void VersionSet::SetupOtherInputs(Compaction* c) {
current_->GetOverlappingInputs(level+1, &new_start, &new_limit, current_->GetOverlappingInputs(level+1, &new_start, &new_limit,
&expanded1, c->parent_index_, &expanded1, c->parent_index_,
&c->parent_index_); &c->parent_index_);
if (expanded1.size() == c->inputs_[1].size() && if (expanded1.size() == c->inputs_[1].size() &&
!FilesInCompaction(expanded1)) { !FilesInCompaction(expanded1)) {
Log(options_->info_log, Log(options_->info_log,
"Expanding@%d %d+%d (%ld+%ld bytes) to %d+%d (%ld+%ld bytes)\n", "Expanding@%d %d+%d (%ld+%ld bytes) to %d+%d (%ld+%ld bytes)\n",
@ -2085,8 +2085,8 @@ Compaction::Compaction(int level, uint64_t target_file_size,
} }
Compaction::~Compaction() { Compaction::~Compaction() {
delete[] level_ptrs_; delete[] level_ptrs_;
delete edit_; delete edit_;
if (input_version_ != NULL) { if (input_version_ != NULL) {
input_version_->Unref(); input_version_->Unref();
} }
@ -2176,7 +2176,7 @@ void Compaction::ReleaseInputs() {
} }
void Compaction::ResetNextCompactionIndex() { void Compaction::ResetNextCompactionIndex() {
input_version_->ResetNextCompactionIndex(level_); input_version_->ResetNextCompactionIndex(level_);
} }
static void InputSummary(std::vector<FileMetaData*>& files, static void InputSummary(std::vector<FileMetaData*>& files,

@ -146,8 +146,8 @@ class Version {
// in increasing order of keys // in increasing order of keys
std::vector<FileMetaData*>* files_; std::vector<FileMetaData*>* files_;
// A list for the same set of files that are stored in files_, // A list for the same set of files that are stored in files_,
// but files in each level are now sorted based on file // but files in each level are now sorted based on file
// size. The file with the largest size is at the front. // size. The file with the largest size is at the front.
// This vector stores the index of the file from files_. // This vector stores the index of the file from files_.
std::vector< std::vector<int> > files_by_size_; std::vector< std::vector<int> > files_by_size_;
@ -191,7 +191,7 @@ class Version {
// to find the next compaction candidate file. // to find the next compaction candidate file.
void ResetNextCompactionIndex(int level) { void ResetNextCompactionIndex(int level) {
next_file_to_compact_by_size_[level] = 0; next_file_to_compact_by_size_[level] = 0;
} }
// No copying allowed // No copying allowed
Version(const Version&); Version(const Version&);
@ -448,7 +448,7 @@ class VersionSet {
uint64_t SizeBeingCompacted(int level); uint64_t SizeBeingCompacted(int level);
// Returns true if any one of the parent files are being compacted // Returns true if any one of the parent files are being compacted
bool ParentRangeInCompaction(const InternalKey* smallest, bool ParentRangeInCompaction(const InternalKey* smallest,
const InternalKey* largest, int level, int* index); const InternalKey* largest, int level, int* index);
// Returns true if any one of the specified files are being compacted // Returns true if any one of the specified files are being compacted
@ -542,7 +542,7 @@ class Compaction {
// mark (or clear) all files that are being compacted // mark (or clear) all files that are being compacted
void MarkFilesBeingCompacted(bool); void MarkFilesBeingCompacted(bool);
// In case of compaction error, reset the nextIndex that is used // In case of compaction error, reset the nextIndex that is used
// to pick up the next file to be compacted from files_by_size_ // to pick up the next file to be compacted from files_by_size_
void ResetNextCompactionIndex(); void ResetNextCompactionIndex();

@ -93,7 +93,7 @@ struct Options {
// on disk) before converting to a sorted on-disk file. // on disk) before converting to a sorted on-disk file.
// //
// Larger values increase performance, especially during bulk loads. // Larger values increase performance, especially during bulk loads.
// Up to max_write_buffer_number write buffers may be held in memory // Up to max_write_buffer_number write buffers may be held in memory
// at the same time, // at the same time,
// so you may wish to adjust this parameter to control memory usage. // so you may wish to adjust this parameter to control memory usage.
// Also, a larger write buffer will result in a longer recovery time // Also, a larger write buffer will result in a longer recovery time
@ -103,7 +103,7 @@ struct Options {
size_t write_buffer_size; size_t write_buffer_size;
// The maximum number of write buffers that are built up in memory. // The maximum number of write buffers that are built up in memory.
// The default is 2, so that when 1 write buffer is being flushed to // The default is 2, so that when 1 write buffer is being flushed to
// storage, new writes can continue to the other write buffer. // storage, new writes can continue to the other write buffer.
// Default: 2 // Default: 2
int max_write_buffer_number; int max_write_buffer_number;
@ -239,7 +239,7 @@ struct Options {
int expanded_compaction_factor; int expanded_compaction_factor;
// Maximum number of bytes in all source files to be compacted in a // Maximum number of bytes in all source files to be compacted in a
// single compaction run. We avoid picking too many files in the // single compaction run. We avoid picking too many files in the
// source level so that we do not exceed the total source bytes // source level so that we do not exceed the total source bytes
// for compaction to exceed // for compaction to exceed
// (source_compaction_factor * targetFileSizeLevel()) many bytes. // (source_compaction_factor * targetFileSizeLevel()) many bytes.
@ -292,7 +292,7 @@ struct Options {
// value is 0 which means that obsolete files get removed after // value is 0 which means that obsolete files get removed after
// every compaction run. // every compaction run.
uint64_t delete_obsolete_files_period_micros; uint64_t delete_obsolete_files_period_micros;
// Maximum number of concurrent background compactions. // Maximum number of concurrent background compactions.
// Default: 1 // Default: 1
int max_background_compactions; int max_background_compactions;
@ -321,12 +321,12 @@ struct Options {
void Dump(Logger * log) const; void Dump(Logger * log) const;
// This method allows an application to modify/delete a key-value at // This method allows an application to modify/delete a key-value at
// the time of compaction. The compaction process invokes this // the time of compaction. The compaction process invokes this
// method for every kv that is being compacted. A return value // method for every kv that is being compacted. A return value
// of false indicates that the kv should be preserved in the // of false indicates that the kv should be preserved in the
// output of this compaction run and a return value of true // output of this compaction run and a return value of true
// indicates that this key-value should be removed from the // indicates that this key-value should be removed from the
// output of the compaction. The application can inspect // output of the compaction. The application can inspect
// the existing value of the key, modify it if needed and // the existing value of the key, modify it if needed and
// return back the new value for this key. The application // return back the new value for this key. The application
@ -336,8 +336,8 @@ struct Options {
// The compaction_filter_args, if specified here, are passed // The compaction_filter_args, if specified here, are passed
// back to the invocation of the CompactionFilter. // back to the invocation of the CompactionFilter.
void* compaction_filter_args; void* compaction_filter_args;
bool (*CompactionFilter)(void* compaction_filter_args, bool (*CompactionFilter)(void* compaction_filter_args,
int level, const Slice& key, int level, const Slice& key,
const Slice& existing_value, Slice** new_value); const Slice& existing_value, Slice** new_value);
// Disable automatic compactions. Manual compactions can still // Disable automatic compactions. Manual compactions can still

@ -27,7 +27,7 @@ class TableBuilder {
public: public:
// Create a builder that will store the contents of the table it is // Create a builder that will store the contents of the table it is
// building in *file. Does not close the file. It is up to the // building in *file. Does not close the file. It is up to the
// caller to close the file after calling Finish(). The output file // caller to close the file after calling Finish(). The output file
// will be part of level specified by 'level'. A value of -1 means // will be part of level specified by 'level'. A value of -1 means
// that the caller does not know which level the output file will reside. // that the caller does not know which level the output file will reside.
TableBuilder(const Options& options, WritableFile* file, int level=-1); TableBuilder(const Options& options, WritableFile* file, int level=-1);

@ -28,7 +28,7 @@ class BloomFilterPolicy : public FilterPolicy {
} }
public: public:
explicit BloomFilterPolicy(int bits_per_key, explicit BloomFilterPolicy(int bits_per_key,
uint32_t (*hash_func)(const Slice& key)) uint32_t (*hash_func)(const Slice& key))
: bits_per_key_(bits_per_key), hash_func_(hash_func) { : bits_per_key_(bits_per_key), hash_func_(hash_func) {
initialize(); initialize();

@ -296,7 +296,7 @@ uint32_t Extend(uint32_t crc, const char* buf, size_t size) {
uint64_t l = crc ^ 0xffffffffu; uint64_t l = crc ^ 0xffffffffu;
// Align n to (1 << m) byte boundary // Align n to (1 << m) byte boundary
#define ALIGN(n, m) ((n + ((1 << m) - 1)) & ~((1 << m) - 1)) #define ALIGN(n, m) ((n + ((1 << m) - 1)) & ~((1 << m) - 1))
#define STEP1 do { \ #define STEP1 do { \
int c = (l & 0xff) ^ *p++; \ int c = (l & 0xff) ^ *p++; \

@ -35,7 +35,7 @@
// //
// This file defines an HDFS environment for leveldb. It uses the libhdfs // This file defines an HDFS environment for leveldb. It uses the libhdfs
// api to access HDFS. All HDFS files created by one instance of leveldb // api to access HDFS. All HDFS files created by one instance of leveldb
// will reside on the same HDFS cluster. // will reside on the same HDFS cluster.
// //
namespace leveldb { namespace leveldb {
@ -65,15 +65,15 @@ class HdfsReadableFile: virtual public SequentialFile, virtual public RandomAcce
Log(mylog, "[hdfs] HdfsReadableFile opening file %s\n", Log(mylog, "[hdfs] HdfsReadableFile opening file %s\n",
filename_.c_str()); filename_.c_str());
hfile_ = hdfsOpenFile(fileSys_, filename_.c_str(), O_RDONLY, 0, 0, 0); hfile_ = hdfsOpenFile(fileSys_, filename_.c_str(), O_RDONLY, 0, 0, 0);
Log(mylog, "[hdfs] HdfsReadableFile opened file %s hfile_=0x%p\n", Log(mylog, "[hdfs] HdfsReadableFile opened file %s hfile_=0x%p\n",
filename_.c_str(), hfile_); filename_.c_str(), hfile_);
} }
virtual ~HdfsReadableFile() { virtual ~HdfsReadableFile() {
Log(mylog, "[hdfs] HdfsReadableFile closing file %s\n", Log(mylog, "[hdfs] HdfsReadableFile closing file %s\n",
filename_.c_str()); filename_.c_str());
hdfsCloseFile(fileSys_, hfile_); hdfsCloseFile(fileSys_, hfile_);
Log(mylog, "[hdfs] HdfsReadableFile closed file %s\n", Log(mylog, "[hdfs] HdfsReadableFile closed file %s\n",
filename_.c_str()); filename_.c_str());
hfile_ = NULL; hfile_ = NULL;
} }
@ -85,7 +85,7 @@ class HdfsReadableFile: virtual public SequentialFile, virtual public RandomAcce
// sequential access, read data at current offset in file // sequential access, read data at current offset in file
virtual Status Read(size_t n, Slice* result, char* scratch) { virtual Status Read(size_t n, Slice* result, char* scratch) {
Status s; Status s;
Log(mylog, "[hdfs] HdfsReadableFile reading %s %ld\n", Log(mylog, "[hdfs] HdfsReadableFile reading %s %ld\n",
filename_.c_str(), n); filename_.c_str(), n);
size_t bytes_read = hdfsRead(fileSys_, hfile_, scratch, (tSize)n); size_t bytes_read = hdfsRead(fileSys_, hfile_, scratch, (tSize)n);
Log(mylog, "[hdfs] HdfsReadableFile read %s\n", filename_.c_str()); Log(mylog, "[hdfs] HdfsReadableFile read %s\n", filename_.c_str());
@ -106,7 +106,7 @@ class HdfsReadableFile: virtual public SequentialFile, virtual public RandomAcce
char* scratch) const { char* scratch) const {
Status s; Status s;
Log(mylog, "[hdfs] HdfsReadableFile preading %s\n", filename_.c_str()); Log(mylog, "[hdfs] HdfsReadableFile preading %s\n", filename_.c_str());
ssize_t bytes_read = hdfsPread(fileSys_, hfile_, offset, ssize_t bytes_read = hdfsPread(fileSys_, hfile_, offset,
(void*)scratch, (tSize)n); (void*)scratch, (tSize)n);
Log(mylog, "[hdfs] HdfsReadableFile pread %s\n", filename_.c_str()); Log(mylog, "[hdfs] HdfsReadableFile pread %s\n", filename_.c_str());
*result = Slice(scratch, (bytes_read < 0) ? 0 : bytes_read); *result = Slice(scratch, (bytes_read < 0) ? 0 : bytes_read);
@ -153,7 +153,7 @@ class HdfsReadableFile: virtual public SequentialFile, virtual public RandomAcce
size = pFileInfo->mSize; size = pFileInfo->mSize;
hdfsFreeFileInfo(pFileInfo, 1); hdfsFreeFileInfo(pFileInfo, 1);
} else { } else {
throw new leveldb::HdfsFatalException("fileSize on unknown file " + throw leveldb::HdfsFatalException("fileSize on unknown file " +
filename_); filename_);
} }
return size; return size;
@ -250,14 +250,14 @@ class HdfsLogger : public Logger {
uint64_t (*gettid_)(); // Return the thread id for the current thread uint64_t (*gettid_)(); // Return the thread id for the current thread
public: public:
HdfsLogger(HdfsWritableFile* f, uint64_t (*gettid)()) HdfsLogger(HdfsWritableFile* f, uint64_t (*gettid)())
: file_(f), gettid_(gettid) { : file_(f), gettid_(gettid) {
Log(mylog, "[hdfs] HdfsLogger opened %s\n", Log(mylog, "[hdfs] HdfsLogger opened %s\n",
file_->getName().c_str()); file_->getName().c_str());
} }
virtual ~HdfsLogger() { virtual ~HdfsLogger() {
Log(mylog, "[hdfs] HdfsLogger closed %s\n", Log(mylog, "[hdfs] HdfsLogger closed %s\n",
file_->getName().c_str()); file_->getName().c_str());
delete file_; delete file_;
if (mylog != NULL && mylog == this) { if (mylog != NULL && mylog == this) {

@ -26,7 +26,7 @@
#include "util/logging.h" #include "util/logging.h"
#include "util/posix_logger.h" #include "util/posix_logger.h"
bool useOsBuffer = 1; // cache data in OS buffers bool useOsBuffer = 1; // cache data in OS buffers
bool useFsReadAhead = 1; // allow filesystem to do readaheads bool useFsReadAhead = 1; // allow filesystem to do readaheads
bool useMmapRead = 0; // do not use mmaps for reading files bool useMmapRead = 0; // do not use mmaps for reading files
bool useMmapWrite = 1; // use mmaps for appending to files bool useMmapWrite = 1; // use mmaps for appending to files
@ -84,7 +84,7 @@ class PosixRandomAccessFile: public RandomAccessFile {
public: public:
PosixRandomAccessFile(const std::string& fname, int fd) PosixRandomAccessFile(const std::string& fname, int fd)
: filename_(fname), fd_(fd) { : filename_(fname), fd_(fd) {
if (!useFsReadAhead) { if (!useFsReadAhead) {
// disable read-aheads // disable read-aheads
posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM); posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM);
@ -741,7 +741,7 @@ class PosixEnv : public Env {
return Status::OK(); return Status::OK();
} }
// Allow increasing the number of worker threads. // Allow increasing the number of worker threads.
virtual void SetBackgroundThreads(int num) { virtual void SetBackgroundThreads(int num) {
if (num > num_threads_) { if (num > num_threads_) {
num_threads_ = num; num_threads_ = num;

@ -127,7 +127,7 @@ Options::Dump(
Log(log," Options.no_block_cache: %d", Log(log," Options.no_block_cache: %d",
no_block_cache); no_block_cache);
Log(log," Options.table_cache_numshardbits: %d", Log(log," Options.table_cache_numshardbits: %d",
table_cache_numshardbits); table_cache_numshardbits);
Log(log," Options.delete_obsolete_files_period_micros: %ld", Log(log," Options.delete_obsolete_files_period_micros: %ld",
delete_obsolete_files_period_micros); delete_obsolete_files_period_micros);
Log(log," Options.max_background_compactions: %d", Log(log," Options.max_background_compactions: %d",

Loading…
Cancel
Save