Skip to content

Commit

Permalink
Fix LITE mode builds on MacOs (facebook#8981)
Browse files Browse the repository at this point in the history
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: facebook#8981

Reviewed By: akankshamahajan15

Differential Revision: D31320141

Pulled By: mrambacher

fbshipit-source-id: d67875ebbd39a9555e4f09b2d37159566dd8a085
  • Loading branch information
mrambacher authored and facebook-github-bot committed Oct 4, 2021
1 parent 2cdaf5c commit 7872298
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions db/blob/blob_file_completion_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ class BlobFileCompletionCallback {
ErrorHandler* error_handler, EventLogger* event_logger,
const std::vector<std::shared_ptr<EventListener>>& listeners,
const std::string& dbname)
: sst_file_manager_(sst_file_manager),
mutex_(mutex),
error_handler_(error_handler),
event_logger_(event_logger),
listeners_(listeners),
dbname_(dbname) {}
: event_logger_(event_logger), listeners_(listeners), dbname_(dbname) {
#ifndef ROCKSDB_LITE
sst_file_manager_ = sst_file_manager;
mutex_ = mutex;
error_handler_ = error_handler;
#else
(void)sst_file_manager;
(void)mutex;
(void)error_handler;
#endif // ROCKSDB_LITE
}

void OnBlobFileCreationStarted(const std::string& file_name,
const std::string& column_family_name,
Expand Down Expand Up @@ -84,9 +89,11 @@ class BlobFileCompletionCallback {
}

private:
#ifndef ROCKSDB_LITE
SstFileManager* sst_file_manager_;
InstrumentedMutex* mutex_;
ErrorHandler* error_handler_;
#endif // ROCKSDB_LITE
EventLogger* event_logger_;
std::vector<std::shared_ptr<EventListener>> listeners_;
std::string dbname_;
Expand Down

0 comments on commit 7872298

Please sign in to comment.