aboutsummaryrefslogtreecommitdiffstats
path: root/storageserver
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-04-06 00:21:15 +0200
committerHenning Baldersheim <balder@oath.com>2018-04-06 00:21:15 +0200
commitacd4af1d2c19119132c6803f15fff70cb65b7d4f (patch)
tree9805b69ea97132a4232310a68de22c31b23447cf /storageserver
parenta20eb679819c3f87037f5ff4c8305111b709b5d0 (diff)
Remove memfile implementation.
Diffstat (limited to 'storageserver')
-rw-r--r--storageserver/CMakeLists.txt1
-rw-r--r--storageserver/src/apps/storaged/storage.cpp5
-rw-r--r--storageserver/src/tests/storageservertest.cpp6
-rw-r--r--storageserver/src/vespa/storageserver/app/CMakeLists.txt1
-rw-r--r--storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.cpp107
-rw-r--r--storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.h59
6 files changed, 4 insertions, 175 deletions
diff --git a/storageserver/CMakeLists.txt b/storageserver/CMakeLists.txt
index 09b48af636e..32afe9c4ad3 100644
--- a/storageserver/CMakeLists.txt
+++ b/storageserver/CMakeLists.txt
@@ -4,7 +4,6 @@ vespa_define_module(
fastos
storage
streamingvisitors_searchvisitor
- memfilepersistence
APPS
src/apps/storaged
diff --git a/storageserver/src/apps/storaged/storage.cpp b/storageserver/src/apps/storaged/storage.cpp
index 9e98f599bc5..0261d8e587e 100644
--- a/storageserver/src/apps/storaged/storage.cpp
+++ b/storageserver/src/apps/storaged/storage.cpp
@@ -16,7 +16,6 @@
#include <vespa/storage/storageutil/utils.h>
#include <vespa/storageserver/app/distributorprocess.h>
#include "forcelink.h"
-#include <vespa/storageserver/app/memfileservicelayerprocess.h>
#include <vespa/storageserver/app/dummyservicelayerprocess.h>
#include <vespa/vespalib/util/programoptions.h>
#include <vespa/vespalib/util/shutdownguard.h>
@@ -39,12 +38,10 @@ Process::UP createProcess(vespalib::stringref configId) {
return Process::UP(new DistributorProcess(configId));
} else switch (serverConfig->persistenceProvider.type) {
case vespa::config::content::core::StorServerConfig::PersistenceProvider::STORAGE:
- return Process::UP(new MemFileServiceLayerProcess(configId));
case vespa::config::content::core::StorServerConfig::PersistenceProvider::DUMMY:
return Process::UP(new DummyServiceLayerProcess(configId));
default:
- throw vespalib::IllegalStateException(
- "Unknown persistence provider.", VESPA_STRLOC);
+ throw vespalib::IllegalStateException("Unknown persistence provider.", VESPA_STRLOC);
}
}
diff --git a/storageserver/src/tests/storageservertest.cpp b/storageserver/src/tests/storageservertest.cpp
index cf8c8f06330..133dcae8115 100644
--- a/storageserver/src/tests/storageservertest.cpp
+++ b/storageserver/src/tests/storageservertest.cpp
@@ -8,7 +8,6 @@
#include <vespa/documentapi/documentapi.h>
#include <vespa/messagebus/rpcmessagebus.h>
#include <vespa/messagebus/network/rpcnetworkparams.h>
-#include <vespa/memfilepersistence/spi/memfilepersistenceprovider.h>
#include <vespa/messagebus/staticthrottlepolicy.h>
#include <vespa/messagebus/testlib/slobrok.h>
#include <vespa/storageapi/mbusprot/storagecommand.h>
@@ -20,12 +19,13 @@
#include <tests/dummystoragelink.h>
#include <vespa/slobrok/sbmirror.h>
#include <vespa/storageserver/app/distributorprocess.h>
-#include <vespa/storageserver/app/memfileservicelayerprocess.h>
+#include <vespa/storageserver/app/dummyservicelayerprocess.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/fnet/frt/supervisor.h>
#include <sys/time.h>
#include <vespa/log/log.h>
+
LOG_SETUP(".storageservertest");
using document::test::makeDocumentBucket;
@@ -175,7 +175,7 @@ namespace {
};
struct Storage : public Node {
- MemFileServiceLayerProcess _process;
+ DummyServiceLayerProcess _process;
StorageComponent::UP _component;
Storage(vdstestlib::DirConfig& config);
diff --git a/storageserver/src/vespa/storageserver/app/CMakeLists.txt b/storageserver/src/vespa/storageserver/app/CMakeLists.txt
index 2311c636228..251fae8d572 100644
--- a/storageserver/src/vespa/storageserver/app/CMakeLists.txt
+++ b/storageserver/src/vespa/storageserver/app/CMakeLists.txt
@@ -5,7 +5,6 @@ vespa_add_library(storageserver_storageapp STATIC
distributorprocess.cpp
servicelayerprocess.cpp
dummyservicelayerprocess.cpp
- memfileservicelayerprocess.cpp
DEPENDS
storage_storageserver
)
diff --git a/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.cpp b/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.cpp
deleted file mode 100644
index bf5a4a73df4..00000000000
--- a/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "memfileservicelayerprocess.h"
-
-#include <vespa/log/log.h>
-LOG_SETUP(".process.servicelayer");
-
-namespace storage {
-
-// MemFileServiceLayerProcess implementation
-
-MemFileServiceLayerProcess::MemFileServiceLayerProcess(
- const config::ConfigUri & configUri)
- : ServiceLayerProcess(configUri),
- _changed(false)
-{
-}
-
-void
-MemFileServiceLayerProcess::shutdown()
-{
- ServiceLayerProcess::shutdown();
- _provider.reset(0);
-}
-
-void
-MemFileServiceLayerProcess::setupConfig(uint64_t subscribeTimeout)
-{
- ServiceLayerProcess::setupConfig(subscribeTimeout);
- _configFetcher.reset(new config::ConfigFetcher(_configUri.getContext()));
- _configFetcher->subscribe<vespa::config::storage::StorDevicesConfig>(_configUri.getConfigId(), this, subscribeTimeout);
- _configFetcher->subscribe<vespa::config::storage::StorMemfilepersistenceConfig>(_configUri.getConfigId(), this, subscribeTimeout);
- _configFetcher->subscribe<vespa::config::content::PersistenceConfig>(_configUri.getConfigId(), this, subscribeTimeout);
- _configFetcher->start();
-}
-
-void
-MemFileServiceLayerProcess::removeConfigSubscriptions()
-{
- _configFetcher.reset(0);
-}
-
-void
-MemFileServiceLayerProcess::setupProvider()
-{
- _provider.reset(new memfile::MemFilePersistenceProvider(
- _context.getComponentRegister(), _configUri));
- _provider->setDocumentRepo(*getTypeRepo());
-}
-
-bool
-MemFileServiceLayerProcess::configUpdated()
-{
- if (ServiceLayerProcess::configUpdated()) return true;
- vespalib::LockGuard guard(_lock);
- return _changed;
-}
-
-void
-MemFileServiceLayerProcess::updateConfig()
-{
- ServiceLayerProcess::updateConfig();
- LOG(info, "Config updated. Sending new config to memfile provider");
- vespalib::LockGuard guard(_lock);
- if (_changed) {
- LOG(debug, "Memfile or device config changed too.");
- if (_nextMemfilepersistence) {
- _provider->setConfig(std::move(_nextMemfilepersistence));
- }
- if (_nextPersistence) {
- _provider->setConfig(std::move(_nextPersistence));
- }
- if (_nextDevices) {
- _provider->setConfig(std::move(_nextDevices));
- }
- }
- _provider->setDocumentRepo(*getTypeRepo());
- _changed = false;
-}
-
-void
-MemFileServiceLayerProcess::configure(
- std::unique_ptr<vespa::config::storage::StorMemfilepersistenceConfig> config)
-{
- vespalib::LockGuard guard(_lock);
- _nextMemfilepersistence = std::move(config);
- _changed = true;
-}
-
-void
-MemFileServiceLayerProcess::configure(
- std::unique_ptr<vespa::config::content::PersistenceConfig> config)
-{
- vespalib::LockGuard guard(_lock);
- _nextPersistence = std::move(config);
- _changed = true;
-}
-
-void
-MemFileServiceLayerProcess::configure(std::unique_ptr<vespa::config::storage::StorDevicesConfig> config)
-{
- vespalib::LockGuard guard(_lock);
- _nextDevices = std::move(config);
- _changed = true;
-}
-
-} // storage
diff --git a/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.h b/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.h
deleted file mode 100644
index bd9a94cd325..00000000000
--- a/storageserver/src/vespa/storageserver/app/memfileservicelayerprocess.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-/**
- * \class storage::ServiceLayerProcess
- *
- * \brief A process running a service layer.
- */
-/**
- * \class storage::MemFileServiceLayerProcess
- *
- * \brief A process running a service layer with memfile persistence provider.
- */
-/**
- * \class storage::RpcServiceLayerProcess
- *
- * \brief A process running a service layer with RPC persistence provider.
- */
-#pragma once
-
-#include <vespa/memfilepersistence/spi/memfilepersistenceprovider.h>
-#include <vespa/storageserver/app/servicelayerprocess.h>
-#include <vespa/vespalib/util/sync.h>
-
-namespace storage {
-
-class MemFileServiceLayerProcess
- : public ServiceLayerProcess,
- public config::IFetcherCallback<vespa::config::storage::StorMemfilepersistenceConfig>,
- public config::IFetcherCallback<vespa::config::storage::StorDevicesConfig>,
- public config::IFetcherCallback<vespa::config::content::PersistenceConfig>
-{
- bool _changed;
- std::unique_ptr<config::ConfigFetcher> _configFetcher;
- std::unique_ptr<vespa::config::storage::StorMemfilepersistenceConfig> _nextMemfilepersistence;
- std::unique_ptr<vespa::config::storage::StorDevicesConfig> _nextDevices;
- std::unique_ptr<vespa::config::content::PersistenceConfig> _nextPersistence;
- memfile::MemFilePersistenceProvider::UP _provider;
- vespalib::Lock _lock;
-
-public:
- MemFileServiceLayerProcess(const config::ConfigUri & configUri);
- ~MemFileServiceLayerProcess() { shutdown(); }
-
- virtual void shutdown() override;
-
- void setupConfig(uint64_t subscribeTimeout) override;
- virtual void removeConfigSubscriptions() override;
- virtual void setupProvider() override;
- virtual bool configUpdated() override;
- virtual void updateConfig() override;
-
- virtual spi::PersistenceProvider& getProvider() override { return *_provider; }
-
- void configure(std::unique_ptr<vespa::config::storage::StorMemfilepersistenceConfig> config) override;
- void configure(std::unique_ptr<vespa::config::storage::StorDevicesConfig> config) override;
- void configure(std::unique_ptr<vespa::config::content::PersistenceConfig> config) override;
-};
-
-} // storage
-