diff options
author | Benety Goh <benety@mongodb.com> | 2017-03-28 12:19:11 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-03-29 14:31:51 -0400 |
commit | 62663f36fb362f9f0fa557b169726eb6bb0400af (patch) | |
tree | 4994836ff2f0f2f06cf5676a12c5f817114b62e2 | |
parent | 5cd89c1122997dd1ae942dc1f0fb5c7948e5d68f (diff) | |
download | mongo-62663f36fb362f9f0fa557b169726eb6bb0400af.tar.gz |
SERVER-28211 removed StorageInterface::startup() and shutdown() functions
There is no need for StorageInterface implementations to have any active internal state.
These functions stopped doing anything meaningful since f8c4d2025431d83cda24c1a193321952372674c7.
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface.h | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl.h | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_mock.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/storage_interface_mock.h | 3 |
7 files changed, 1 insertions, 28 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index f56ac12bfbb..5025269fa4e 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -275,8 +275,6 @@ void ReplicationCoordinatorExternalStateImpl::startThreads(const ReplSettings& s _writerPool = SyncTail::makeWriterPool(); - _storageInterface->startup(); - _startedThreads = true; } @@ -309,7 +307,6 @@ void ReplicationCoordinatorExternalStateImpl::shutdown(OperationContext* opCtx) log() << "Stopping replication storage threads"; _taskExecutor->shutdown(); _taskExecutor->join(); - _storageInterface->shutdown(); } } diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h index 85925ca53f5..d75bc58a381 100644 --- a/src/mongo/db/repl/storage_interface.h +++ b/src/mongo/db/repl/storage_interface.h @@ -98,9 +98,6 @@ public: StorageInterface() = default; virtual ~StorageInterface() = default; - virtual void startup() = 0; - virtual void shutdown() = 0; - // MinValid and Initial Sync Flag. /** * Returns true if initial sync was started but has not not completed. diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp index 203db79141c..09f31ea6ab7 100644 --- a/src/mongo/db/repl/storage_interface_impl.cpp +++ b/src/mongo/db/repl/storage_interface_impl.cpp @@ -67,7 +67,6 @@ #include "mongo/db/service_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/old_thread_pool.h" -#include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" @@ -91,14 +90,6 @@ StorageInterfaceImpl::StorageInterfaceImpl() StorageInterfaceImpl::StorageInterfaceImpl(const NamespaceString& minValidNss) : _minValidNss(minValidNss) {} -StorageInterfaceImpl::~StorageInterfaceImpl() { - DESTRUCTOR_GUARD(shutdown();); -} - -void StorageInterfaceImpl::startup() {} - -void StorageInterfaceImpl::shutdown() {} - NamespaceString StorageInterfaceImpl::getMinValidNss() const { return _minValidNss; } diff --git a/src/mongo/db/repl/storage_interface_impl.h b/src/mongo/db/repl/storage_interface_impl.h index 2f6df10c61f..de5ee3c1067 100644 --- a/src/mongo/db/repl/storage_interface_impl.h +++ b/src/mongo/db/repl/storage_interface_impl.h @@ -52,10 +52,6 @@ public: StorageInterfaceImpl(); explicit StorageInterfaceImpl(const NamespaceString& minValidNss); - virtual ~StorageInterfaceImpl(); - - void startup() override; - void shutdown() override; /** * Returns namespace of collection containing the minvalid boundaries and initial sync flag. diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp index 5e808ae2c06..c138a9f0969 100644 --- a/src/mongo/db/repl/storage_interface_impl_test.cpp +++ b/src/mongo/db/repl/storage_interface_impl_test.cpp @@ -473,7 +473,6 @@ TEST_F(StorageInterfaceImplWithReplCoordTest, InsertMissingDocFailesIfCollection TEST_F(StorageInterfaceImplWithReplCoordTest, CreateCollectionWithIDIndexCommits) { auto opCtx = getOperationContext(); StorageInterfaceImpl storage; - storage.startup(); NamespaceString nss("foo.bar"); CollectionOptions opts; std::vector<BSONObj> indexes; @@ -500,7 +499,6 @@ void _testDestroyUncommitedCollectionBulkLoader( std::vector<BSONObj> secondaryIndexes, stdx::function<void(std::unique_ptr<CollectionBulkLoader> loader)> destroyLoaderFn) { StorageInterfaceImpl storage; - storage.startup(); NamespaceString nss("foo.bar"); CollectionOptions opts; auto loaderStatus = @@ -572,7 +570,6 @@ TEST_F(StorageInterfaceImplWithReplCoordTest, TEST_F(StorageInterfaceImplWithReplCoordTest, CreateCollectionThatAlreadyExistsFails) { auto opCtx = getOperationContext(); StorageInterfaceImpl storage; - storage.startup(); NamespaceString nss("test.system.indexes"); createCollection(opCtx, nss); @@ -705,7 +702,6 @@ TEST_F(StorageInterfaceImplWithReplCoordTest, FindDocumentsReturnsIndexOptionsConflictIfIndexIsAPartialIndex) { auto opCtx = getOperationContext(); StorageInterfaceImpl storage; - storage.startup(); auto nss = makeNamespace(_agent); std::vector<BSONObj> indexes = {BSON("v" << 1 << "key" << BSON("x" << 1) << "name" << "x_1" diff --git a/src/mongo/db/repl/storage_interface_mock.cpp b/src/mongo/db/repl/storage_interface_mock.cpp index 4b534c05d6a..f067a759032 100644 --- a/src/mongo/db/repl/storage_interface_mock.cpp +++ b/src/mongo/db/repl/storage_interface_mock.cpp @@ -38,8 +38,7 @@ namespace mongo { namespace repl { -void StorageInterfaceMock::startup() {} -void StorageInterfaceMock::shutdown() {} + bool StorageInterfaceMock::getInitialSyncFlag(OperationContext* opCtx) const { stdx::lock_guard<stdx::mutex> lock(_initialSyncFlagMutex); return _initialSyncFlag; diff --git a/src/mongo/db/repl/storage_interface_mock.h b/src/mongo/db/repl/storage_interface_mock.h index ffb0e5107ae..da1961464e2 100644 --- a/src/mongo/db/repl/storage_interface_mock.h +++ b/src/mongo/db/repl/storage_interface_mock.h @@ -122,9 +122,6 @@ public: StorageInterfaceMock() = default; - void startup() override; - void shutdown() override; - bool getInitialSyncFlag(OperationContext* opCtx) const override; void setInitialSyncFlag(OperationContext* opCtx) override; void clearInitialSyncFlag(OperationContext* opCtx) override; |