From 93a0e9f3faf2f90f39d58d7d8370748c2ee05197 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Thu, 20 Jan 2022 08:43:20 -0800 Subject: [PATCH] Mark destructors as override (#9404) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/9404 It is better practice to mark destructors as override. Without this change there can be issues building with -Wsuggest-destructor-override. Reviewed By: riversand963 Differential Revision: D33671992 fbshipit-source-id: 75b0c15010cbab5fbc071c150fef1dc85d5d9d96 --- include/rocksdb/comparator.h | 2 +- include/rocksdb/customizable.h | 2 +- include/rocksdb/file_checksum.h | 2 +- include/rocksdb/listener.h | 2 +- include/rocksdb/memtablerep.h | 2 +- include/rocksdb/sst_partitioner.h | 4 ++-- include/rocksdb/statistics.h | 2 +- include/rocksdb/table_properties.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/rocksdb/comparator.h b/include/rocksdb/comparator.h index 9c0694cc8..4b1b61eb4 100644 --- a/include/rocksdb/comparator.h +++ b/include/rocksdb/comparator.h @@ -40,7 +40,7 @@ class Comparator : public Customizable { return *this; } - virtual ~Comparator() {} + ~Comparator() override {} static Status CreateFromString(const ConfigOptions& opts, const std::string& id, diff --git a/include/rocksdb/customizable.h b/include/rocksdb/customizable.h index 0a018eace..92f7504ae 100644 --- a/include/rocksdb/customizable.h +++ b/include/rocksdb/customizable.h @@ -55,7 +55,7 @@ namespace ROCKSDB_NAMESPACE { */ class Customizable : public Configurable { public: - virtual ~Customizable() {} + ~Customizable() override {} // Returns the name of this class of Customizable virtual const char* Name() const = 0; diff --git a/include/rocksdb/file_checksum.h b/include/rocksdb/file_checksum.h index 0645299e1..758bae4ac 100644 --- a/include/rocksdb/file_checksum.h +++ b/include/rocksdb/file_checksum.h @@ -74,7 +74,7 @@ class FileChecksumGenerator { // including data loss, unreported corruption, deadlocks, and more. class FileChecksumGenFactory : public Customizable { public: - virtual ~FileChecksumGenFactory() {} + ~FileChecksumGenFactory() override {} static const char* Type() { return "FileChecksumGenFactory"; } static Status CreateFromString( const ConfigOptions& options, const std::string& value, diff --git a/include/rocksdb/listener.h b/include/rocksdb/listener.h index cf54e1248..dec7ea799 100644 --- a/include/rocksdb/listener.h +++ b/include/rocksdb/listener.h @@ -750,7 +750,7 @@ class EventListener : public Customizable { // happens. ShouldBeNotifiedOnFileIO should be set to true to get a callback. virtual void OnIOError(const IOErrorInfo& /*info*/) {} - virtual ~EventListener() {} + ~EventListener() override {} }; #else diff --git a/include/rocksdb/memtablerep.h b/include/rocksdb/memtablerep.h index 66332978d..3484a5a21 100644 --- a/include/rocksdb/memtablerep.h +++ b/include/rocksdb/memtablerep.h @@ -294,7 +294,7 @@ class MemTableRep { // new MemTableRep objects class MemTableRepFactory : public Customizable { public: - virtual ~MemTableRepFactory() {} + ~MemTableRepFactory() override {} static const char* Type() { return "MemTableRepFactory"; } static Status CreateFromString(const ConfigOptions& config_options, diff --git a/include/rocksdb/sst_partitioner.h b/include/rocksdb/sst_partitioner.h index e2370132c..3af8e9492 100644 --- a/include/rocksdb/sst_partitioner.h +++ b/include/rocksdb/sst_partitioner.h @@ -83,7 +83,7 @@ class SstPartitioner { // including data loss, unreported corruption, deadlocks, and more. class SstPartitionerFactory : public Customizable { public: - virtual ~SstPartitionerFactory() {} + ~SstPartitionerFactory() override {} static const char* Type() { return "SstPartitionerFactory"; } static Status CreateFromString( const ConfigOptions& options, const std::string& value, @@ -124,7 +124,7 @@ class SstPartitionerFixedPrefixFactory : public SstPartitionerFactory { public: explicit SstPartitionerFixedPrefixFactory(size_t len); - virtual ~SstPartitionerFixedPrefixFactory() {} + ~SstPartitionerFixedPrefixFactory() override {} static const char* kClassName() { return "SstPartitionerFixedPrefixFactory"; } const char* Name() const override { return kClassName(); } diff --git a/include/rocksdb/statistics.h b/include/rocksdb/statistics.h index 6525493f4..aae4954a2 100644 --- a/include/rocksdb/statistics.h +++ b/include/rocksdb/statistics.h @@ -587,7 +587,7 @@ enum StatsLevel : uint8_t { // including data loss, unreported corruption, deadlocks, and more. class Statistics : public Customizable { public: - virtual ~Statistics() {} + ~Statistics() override {} static const char* Type() { return "Statistics"; } static Status CreateFromString(const ConfigOptions& opts, const std::string& value, diff --git a/include/rocksdb/table_properties.h b/include/rocksdb/table_properties.h index e26b43d77..0c91fa854 100644 --- a/include/rocksdb/table_properties.h +++ b/include/rocksdb/table_properties.h @@ -151,7 +151,7 @@ class TablePropertiesCollectorFactory : public Customizable { static const int kUnknownLevelAtCreation = -1; }; - virtual ~TablePropertiesCollectorFactory() {} + ~TablePropertiesCollectorFactory() override {} static const char* Type() { return "TablePropertiesCollectorFactory"; } static Status CreateFromString( const ConfigOptions& options, const std::string& value,