Fix LITE mode builds on MacOs (#8981)

Summary:
On MacOS, there were errors building in LITE mode related to unused private member variables:

In file included from ./db/compaction/compaction_job.h:20:
./db/blob/blob_file_completion_callback.h:87:19: error: private field ‘sst_file_manager_’ is not used [-Werror,-Wunused-private-field]
  SstFileManager* sst_file_manager_;
                  ^
./db/blob/blob_file_completion_callback.h:88:22: error: private field ‘mutex_’ is not used [-Werror,-Wunused-private-field]
  InstrumentedMutex* mutex_;
                     ^
./db/blob/blob_file_completion_callback.h:89:17: error: private field ‘error_handler_’ is not used [-Werror,-Wunused-private-field]
  ErrorHandler* error_handler_;

This PR resolves those build issues by removing the values as members in LITE mode and fixing the constructor to ignore the input values in LITE mode (otherwise we get unused parameter warnings).

Tested by validating compiles without warnings.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8981

Reviewed By: akankshamahajan15

Differential Revision: D31320141

Pulled By: mrambacher

fbshipit-source-id: d67875ebbd39a9555e4f09b2d37159566dd8a085
main
mrambacher 3 years ago committed by Facebook GitHub Bot
parent 2cdaf5ca5b
commit 787229837e
  1. 19
      db/blob/blob_file_completion_callback.h

@ -22,12 +22,17 @@ class BlobFileCompletionCallback {
ErrorHandler* error_handler, EventLogger* event_logger, ErrorHandler* error_handler, EventLogger* event_logger,
const std::vector<std::shared_ptr<EventListener>>& listeners, const std::vector<std::shared_ptr<EventListener>>& listeners,
const std::string& dbname) const std::string& dbname)
: sst_file_manager_(sst_file_manager), : event_logger_(event_logger), listeners_(listeners), dbname_(dbname) {
mutex_(mutex), #ifndef ROCKSDB_LITE
error_handler_(error_handler), sst_file_manager_ = sst_file_manager;
event_logger_(event_logger), mutex_ = mutex;
listeners_(listeners), error_handler_ = error_handler;
dbname_(dbname) {} #else
(void)sst_file_manager;
(void)mutex;
(void)error_handler;
#endif // ROCKSDB_LITE
}
void OnBlobFileCreationStarted(const std::string& file_name, void OnBlobFileCreationStarted(const std::string& file_name,
const std::string& column_family_name, const std::string& column_family_name,
@ -84,9 +89,11 @@ class BlobFileCompletionCallback {
} }
private: private:
#ifndef ROCKSDB_LITE
SstFileManager* sst_file_manager_; SstFileManager* sst_file_manager_;
InstrumentedMutex* mutex_; InstrumentedMutex* mutex_;
ErrorHandler* error_handler_; ErrorHandler* error_handler_;
#endif // ROCKSDB_LITE
EventLogger* event_logger_; EventLogger* event_logger_;
std::vector<std::shared_ptr<EventListener>> listeners_; std::vector<std::shared_ptr<EventListener>> listeners_;
std::string dbname_; std::string dbname_;

Loading…
Cancel
Save