From 83031e734313e773e1cdd5a782dba2c52d0bdbec Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan Date: Thu, 15 Apr 2021 09:44:00 -0700 Subject: [PATCH] Fix for LITE mode failure on MacOS (#8189) Summary: Fix for failure to build in LITE mode on MacOs from BlobFileCompletionCallback unused private fields. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8189 Reviewed By: jay-zhuang Differential Revision: D27768341 Pulled By: akankshamahajan15 fbshipit-source-id: 14d31d7a9b52d308d9f9f27feff1977c5550622f --- db/blob/blob_file_builder.cc | 1 - db/blob/blob_file_completion_callback.h | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/db/blob/blob_file_builder.cc b/db/blob/blob_file_builder.cc index 4ef836a6bd..1fbc636b8d 100644 --- a/db/blob/blob_file_builder.cc +++ b/db/blob/blob_file_builder.cc @@ -306,7 +306,6 @@ Status BlobFileBuilder::CloseBlobFile() { " total blobs, %" PRIu64 " total bytes", column_family_name_.c_str(), job_id_, blob_file_number, blob_count_, blob_bytes_); - if (blob_callback_) { s = blob_callback_->OnBlobFileCompleted(blob_file_paths_->back()); } diff --git a/db/blob/blob_file_completion_callback.h b/db/blob/blob_file_completion_callback.h index 58d708eb1c..42b6def893 100644 --- a/db/blob/blob_file_completion_callback.h +++ b/db/blob/blob_file_completion_callback.h @@ -16,6 +16,14 @@ namespace ROCKSDB_NAMESPACE { class BlobFileCompletionCallback { public: +#ifdef ROCKSDB_LITE + BlobFileCompletionCallback(SstFileManager* /*sst_file_manager*/, + InstrumentedMutex* /*mutex*/, + ErrorHandler* /*error_handler*/) {} + Status OnBlobFileCompleted(const std::string& /*file_name*/) { + return Status::OK(); + } +#else BlobFileCompletionCallback(SstFileManager* sst_file_manager, InstrumentedMutex* mutex, ErrorHandler* error_handler) @@ -25,8 +33,6 @@ class BlobFileCompletionCallback { Status OnBlobFileCompleted(const std::string& file_name) { Status s; - -#ifndef ROCKSDB_LITE auto sfm = static_cast(sst_file_manager_); if (sfm) { // Report new blob files to SstFileManagerImpl @@ -39,9 +45,6 @@ class BlobFileCompletionCallback { error_handler_->SetBGError(s, BackgroundErrorReason::kFlush); } } -#else - (void)file_name; -#endif // ROCKSDB_LITE return s; } @@ -49,5 +52,6 @@ class BlobFileCompletionCallback { SstFileManager* sst_file_manager_; InstrumentedMutex* mutex_; ErrorHandler* error_handler_; +#endif // ROCKSDB_LITE }; } // namespace ROCKSDB_NAMESPACE