From da54d36a9635835bedc0edd6202dfadb00811b4d Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Thu, 19 Jan 2017 15:43:51 -0800 Subject: [PATCH] Disable IngestExternalFile in ReadOnly mode Summary: Disable IngestExternalFile() in read only mode Closes https://github.com/facebook/rocksdb/pull/1781 Differential Revision: D4439179 Pulled By: IslamAbdelRahman fbshipit-source-id: b7e46e7 --- db/compacted_db_impl.h | 7 +++++++ db/db_impl_readonly.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/db/compacted_db_impl.h b/db/compacted_db_impl.h index 9c42010a6..6d6d512fd 100644 --- a/db/compacted_db_impl.h +++ b/db/compacted_db_impl.h @@ -76,6 +76,13 @@ class CompactedDBImpl : public DBImpl { ColumnFamilyHandle* column_family) override { return Status::NotSupported("Not supported in compacted db mode."); } + using DB::IngestExternalFile; + virtual Status IngestExternalFile( + ColumnFamilyHandle* column_family, + const std::vector& external_files, + const IngestExternalFileOptions& ingestion_options) override { + return Status::NotSupported("Not supported in compacted db mode."); + } private: friend class DB; diff --git a/db/db_impl_readonly.h b/db/db_impl_readonly.h index a410a4e32..56d207e6d 100644 --- a/db/db_impl_readonly.h +++ b/db/db_impl_readonly.h @@ -79,7 +79,6 @@ class DBImplReadOnly : public DBImpl { return Status::NotSupported("Not supported operation in read only mode."); } -#ifndef ROCKSDB_LITE virtual Status DisableFileDeletions() override { return Status::NotSupported("Not supported operation in read only mode."); } @@ -92,7 +91,6 @@ class DBImplReadOnly : public DBImpl { bool flush_memtable = true) override { return Status::NotSupported("Not supported operation in read only mode."); } -#endif // ROCKSDB_LITE using DBImpl::Flush; virtual Status Flush(const FlushOptions& options, @@ -105,6 +103,14 @@ class DBImplReadOnly : public DBImpl { return Status::NotSupported("Not supported operation in read only mode."); } + using DB::IngestExternalFile; + virtual Status IngestExternalFile( + ColumnFamilyHandle* column_family, + const std::vector& external_files, + const IngestExternalFileOptions& ingestion_options) override { + return Status::NotSupported("Not supported operation in read only mode."); + } + private: friend class DB;