diff options
author | sdong <siying.d@fb.com> | 2017-06-26 17:47:20 -0700 |
---|---|---|
committer | sdong <siying.d@fb.com> | 2017-06-26 17:47:20 -0700 |
commit | 72cf57d4b40e5c809839afc1c62dc13e533b8ec6 (patch) | |
tree | 2e9b94e00dc97c735f61a86861c283b4ac6fecb6 | |
parent | 769778e2dc2a4e471f08d8519676634d05118fa2 (diff) |
Apply CLANG Tidyv5.5.1
-rw-r--r-- | include/rocksdb/env.h | 19 | ||||
-rw-r--r-- | include/rocksdb/flush_block_policy.h | 4 | ||||
-rw-r--r-- | include/rocksdb/merge_operator.h | 20 | ||||
-rw-r--r-- | include/rocksdb/utilities/sim_cache.h | 6 | ||||
-rw-r--r-- | include/rocksdb/utilities/transaction_db.h | 2 | ||||
-rw-r--r-- | include/rocksdb/utilities/write_batch_with_index.h | 2 | ||||
-rw-r--r-- | include/rocksdb/write_batch.h | 2 |
7 files changed, 29 insertions, 26 deletions
diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 670a7e546..da9f51c5f 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -900,7 +900,7 @@ class EnvWrapper : public Env { public: // Initialize an EnvWrapper that delegates all calls to *t explicit EnvWrapper(Env* t) : target_(t) { } - virtual ~EnvWrapper(); + ~EnvWrapper() override; // Return the target to which this Env forwards all calls Env* target() const { return target_; } @@ -935,8 +935,8 @@ class EnvWrapper : public Env { const EnvOptions& options) override { return target_->NewRandomRWFile(fname, result, options); } - virtual Status NewDirectory(const std::string& name, - unique_ptr<Directory>* result) override { + Status NewDirectory(const std::string& name, unique_ptr<Directory>* result) + override { return target_->NewDirectory(name, result); } Status FileExists(const std::string& f) override { @@ -998,15 +998,14 @@ class EnvWrapper : public Env { return target_->StartThread(f, a); } void WaitForJoin() override { return target_->WaitForJoin(); } - virtual unsigned int GetThreadPoolQueueLen( - Priority pri = LOW) const override { + unsigned int GetThreadPoolQueueLen(Priority pri = LOW) const override { return target_->GetThreadPoolQueueLen(pri); } - virtual Status GetTestDirectory(std::string* path) override { + Status GetTestDirectory(std::string* path) override { return target_->GetTestDirectory(path); } - virtual Status NewLogger(const std::string& fname, - shared_ptr<Logger>* result) override { + Status NewLogger(const std::string& fname, shared_ptr<Logger>* result) + override { return target_->NewLogger(fname, result); } uint64_t NowMicros() override { return target_->NowMicros(); } @@ -1091,10 +1090,10 @@ class WritableFileWrapper : public WritableFile { return target_->InvalidateCache(offset, length); } - virtual void SetPreallocationBlockSize(size_t size) override { + void SetPreallocationBlockSize(size_t size) override { target_->SetPreallocationBlockSize(size); } - virtual void PrepareWrite(size_t offset, size_t len) override { + void PrepareWrite(size_t offset, size_t len) override { target_->PrepareWrite(offset, len); } diff --git a/include/rocksdb/flush_block_policy.h b/include/rocksdb/flush_block_policy.h index 765590171..1dff13b31 100644 --- a/include/rocksdb/flush_block_policy.h +++ b/include/rocksdb/flush_block_policy.h @@ -48,11 +48,11 @@ class FlushBlockBySizePolicyFactory : public FlushBlockPolicyFactory { public: FlushBlockBySizePolicyFactory() {} - virtual const char* Name() const override { + const char* Name() const override { return "FlushBlockBySizePolicyFactory"; } - virtual FlushBlockPolicy* NewFlushBlockPolicy( + FlushBlockPolicy* NewFlushBlockPolicy( const BlockBasedTableOptions& table_options, const BlockBuilder& data_block_builder) const override; diff --git a/include/rocksdb/merge_operator.h b/include/rocksdb/merge_operator.h index 6ec34fe3e..eb76143c7 100644 --- a/include/rocksdb/merge_operator.h +++ b/include/rocksdb/merge_operator.h @@ -188,7 +188,7 @@ class MergeOperator { // The simpler, associative merge operator. class AssociativeMergeOperator : public MergeOperator { public: - virtual ~AssociativeMergeOperator() {} + ~AssociativeMergeOperator() override {} // Gives the client a way to express the read -> modify -> write semantics // key: (IN) The key that's associated with this merge operation. @@ -212,14 +212,16 @@ class AssociativeMergeOperator : public MergeOperator { private: // Default implementations of the MergeOperator functions - virtual bool FullMergeV2(const MergeOperationInput& merge_in, - MergeOperationOutput* merge_out) const override; - - virtual bool PartialMerge(const Slice& key, - const Slice& left_operand, - const Slice& right_operand, - std::string* new_value, - Logger* logger) const override; + bool FullMergeV2( + const MergeOperationInput& merge_in, + MergeOperationOutput* merge_out) const override; + + bool PartialMerge( + const Slice& key, + const Slice& left_operand, + const Slice& right_operand, + std::string* new_value, + Logger* logger) const override; }; } // namespace rocksdb diff --git a/include/rocksdb/utilities/sim_cache.h b/include/rocksdb/utilities/sim_cache.h index 64cb643ce..a7de08977 100644 --- a/include/rocksdb/utilities/sim_cache.h +++ b/include/rocksdb/utilities/sim_cache.h @@ -39,9 +39,11 @@ class SimCache : public Cache { public: SimCache() {} - virtual ~SimCache() {} + ~SimCache() override {} - virtual const char* Name() const override { return "SimCache"; } + const char* Name() const override { + return "SimCache"; + } // returns the maximum configured capacity of the simcache for simulation virtual size_t GetSimCapacity() const = 0; diff --git a/include/rocksdb/utilities/transaction_db.h b/include/rocksdb/utilities/transaction_db.h index ec9743892..e14f9e06d 100644 --- a/include/rocksdb/utilities/transaction_db.h +++ b/include/rocksdb/utilities/transaction_db.h @@ -148,7 +148,7 @@ class TransactionDB : public StackableDB { StackableDB* db, const TransactionDBOptions& txn_db_options, const std::vector<size_t>& compaction_enabled_cf_indices, const std::vector<ColumnFamilyHandle*>& handles, TransactionDB** dbptr); - virtual ~TransactionDB() {} + ~TransactionDB() override {} // Starts a new Transaction. // diff --git a/include/rocksdb/utilities/write_batch_with_index.h b/include/rocksdb/utilities/write_batch_with_index.h index ba6d67057..f429610c4 100644 --- a/include/rocksdb/utilities/write_batch_with_index.h +++ b/include/rocksdb/utilities/write_batch_with_index.h @@ -97,7 +97,7 @@ class WriteBatchWithIndex : public WriteBatchBase { size_t reserved_bytes = 0, bool overwrite_key = false, size_t max_bytes = 0); - virtual ~WriteBatchWithIndex(); + ~WriteBatchWithIndex() override; using WriteBatchBase::Put; Status Put(ColumnFamilyHandle* column_family, const Slice& key, diff --git a/include/rocksdb/write_batch.h b/include/rocksdb/write_batch.h index d98c56261..432a7c19b 100644 --- a/include/rocksdb/write_batch.h +++ b/include/rocksdb/write_batch.h @@ -61,7 +61,7 @@ struct SavePoint { class WriteBatch : public WriteBatchBase { public: explicit WriteBatch(size_t reserved_bytes = 0, size_t max_bytes = 0); - ~WriteBatch(); + ~WriteBatch() override; using WriteBatchBase::Put; // Store the mapping "key->value" in the database. |