aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-03-02 14:35:38 +0100
committerGitHub <noreply@github.com>2021-03-02 14:35:38 +0100
commit916b55c87dc57ac702a56ce9bf08553ec891e7e8 (patch)
treedecc0c442f60e03bbef68fddcd0b5ecaa318e0e9 /searchcore
parentc13824aaf093c63d642a03d189e45862107ea888 (diff)
parent779c189de131e6fe730bb738f6fb2421c2a2b755 (diff)
Merge pull request #16739 from vespa-engine/balder/do-not-promise-more-than-you-need
Balder/do not promise more than you need
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h9
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_v2_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h4
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h1
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp1
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/indexmanager.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/bucketmovejobv2.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/document_db_explorer.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/document_db_explorer.h9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h15
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/test.h1
29 files changed, 67 insertions, 36 deletions
diff --git a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
index 52abfed2289..62f87c984d0 100644
--- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
@@ -3,8 +3,10 @@
#include <vespa/searchcore/proton/server/ibucketstatechangedhandler.h>
#include <vespa/searchcore/proton/server/ibucketmodifiedhandler.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/test/test.h>
#include <vespa/persistence/spi/test.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp b/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
index 57bab0607d3..149af7dcf79 100644
--- a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
@@ -2,6 +2,7 @@
#include <vespa/searchcore/proton/server/clusterstatehandler.h>
#include <vespa/searchcore/proton/server/iclusterstatechangedhandler.h>
#include <vespa/searchcore/proton/test/test.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vdslib/state/clusterstate.h>
diff --git a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
index c01a0083674..48490706a47 100644
--- a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
@@ -4,6 +4,7 @@
#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/server/combiningfeedview.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/test/test.h>
#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/document/update/documentupdate.h>
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 6d39e5709be..b9894a92447 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -18,8 +18,11 @@
#include <vespa/searchcore/proton/server/fast_access_document_retriever.h>
#include <vespa/searchcore/proton/server/i_document_subdb_owner.h>
#include <vespa/searchcore/proton/server/igetserialnum.h>
+#include <vespa/searchcore/proton/server/executorthreadingservice.h>
#include <vespa/searchcore/proton/server/minimal_document_retriever.h>
#include <vespa/searchcore/proton/server/searchabledocsubdb.h>
+#include <vespa/searchcore/proton/server/document_subdb_initializer.h>
+#include <vespa/searchcore/proton/server/reconfig_params.h>
#include <vespa/searchcore/proton/matching/querylimiter.h>
#include <vespa/searchcore/proton/test/test.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
@@ -30,6 +33,7 @@
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/size_literals.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
using namespace cloud::config::filedistribution;
using namespace document;
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp
index 147161f7791..714d519cab3 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp
@@ -1,6 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketmover_common.h"
+#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/vespalib/testkit/test_macros.h>
using vespalib::IDestructorCallback;
@@ -81,4 +82,9 @@ assertEqual(const document::BucketId &bucket, const proton::test::Document &doc,
return true;
}
+void
+MySubDb::setBucketState(const BucketId &bucketId, bool active) {
+ _metaStore.setBucketState(bucketId, active);
+}
+
}
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
index ec4135484ab..e955f017d67 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
@@ -16,6 +16,9 @@
#include <vespa/searchcore/proton/test/test.h>
#include <vespa/document/test/make_bucket_space.h>
+namespace proton {
+ class DocumentMetaStore;
+}
namespace proton::move::test {
struct MyMoveOperationLimiter : public IMoveOperationLimiter {
@@ -97,7 +100,7 @@ struct MySubDb {
using DocumentTypeRepo = document::DocumentTypeRepo;
using DocumentVector = proton::test::DocumentVector;
using UserDocuments = proton::test::UserDocuments;
- DocumentMetaStore::SP _metaStoreSP;
+ std::shared_ptr<DocumentMetaStore> _metaStoreSP;
DocumentMetaStore &_metaStore;
std::shared_ptr<MyDocumentRetriever> _realRetriever;
std::shared_ptr<IDocumentRetriever> _retriever;
@@ -120,9 +123,7 @@ struct MySubDb {
return _docs.getGidOrderDocs(userId);
}
- void setBucketState(const BucketId &bucketId, bool active) {
- _metaStore.setBucketState(bucketId, active);
- }
+ void setBucketState(const BucketId &bucketId, bool active);
};
struct MyCountJobRunner : public IMaintenanceJobRunner {
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
index 5556ed0d475..85f80293377 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
@@ -2,6 +2,7 @@
#include "bucketmover_common.h"
#include <vespa/searchcore/proton/server/bucketmovejob.h>
+#include <vespa/searchcore/proton/server/document_db_maintenance_config.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_v2_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_v2_test.cpp
index 3ee0a77eca7..99692ec53bd 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_v2_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_v2_test.cpp
@@ -2,7 +2,10 @@
#include "bucketmover_common.h"
#include <vespa/searchcore/proton/server/bucketmovejobv2.h>
+#include <vespa/searchcore/proton/server/executor_thread_service.h>
+#include <vespa/searchcore/proton/server/document_db_maintenance_config.h>
#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
index ae504fef603..f49d806b6d4 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
@@ -2,6 +2,7 @@
#include "bucketmover_common.h"
#include <vespa/searchcore/proton/server/documentbucketmover.h>
+#include <vespa/searchcore/proton/common/pendinglidtracker.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index d560a474ec4..3c65326b11a 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -17,6 +17,7 @@
#include <vespa/searchcore/proton/reference/i_document_db_reference.h>
#include <vespa/searchcore/proton/server/bootstrapconfig.h>
#include <vespa/searchcore/proton/server/document_db_explorer.h>
+#include <vespa/searchcore/proton/server/documentdb.h>
#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp
index 5a68e46c57e..cd305c51810 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp
@@ -1,8 +1,10 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "lid_space_common.h"
+#include <vespa/searchcore/proton/test/dummy_document_sub_db.h>
using vespalib::make_string_short::fmt;
+using proton::test::DummyDocumentSubDb;
MyScanIterator::MyScanIterator(const MyHandler & handler, const LidVector &lids)
: _handler(handler),
@@ -214,8 +216,8 @@ MyDocumentRetriever::parseSelect(const vespalib::string&) const {
}
MySubDb::MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo)
- : sub_db(std::move(bucket_db), SUBDB_ID),
- maintenance_sub_db(sub_db.getName(), sub_db.getSubDbId(), sub_db.getDocumentMetaStoreContext().getSP(),
+ : sub_db(std::make_unique<DummyDocumentSubDb>(std::move(bucket_db), SUBDB_ID)),
+ maintenance_sub_db(sub_db->getName(), sub_db->getSubDbId(), sub_db->getDocumentMetaStoreContext().getSP(),
std::make_shared<MyDocumentRetriever>(repo, store),
std::make_shared<MyFeedView>(repo),
&_pendingLidsForCommit)
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h
index 9ef96762e2d..31b245d7e72 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h
@@ -9,6 +9,7 @@
#include <vespa/searchcore/proton/server/remove_operations_rate_tracker.h>
#include <vespa/searchcore/proton/server/maintenancedocumentsubdb.h>
#include <vespa/searchcore/proton/server/i_operation_storer.h>
+#include <vespa/searchcore/proton/common/pendinglidtracker.h>
#include <vespa/searchcore/proton/documentmetastore/operation_listener.h>
#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
#include <vespa/searchcore/proton/feedoperation/compact_lid_space_operation.h>
@@ -46,6 +47,7 @@ using LidPair = std::pair<uint32_t, uint32_t>;
using LidPairVector = std::vector<LidPair>;
struct MyHandler;
+namespace proton::test { class DummyDocumentSubDb; }
struct MyScanIterator : public IDocumentScanIterator {
const MyHandler & _handler;
LidVector _lids;
@@ -137,7 +139,7 @@ struct MyDocumentRetriever : public DocumentRetrieverBaseForTest {
};
struct MySubDb {
- test::DummyDocumentSubDb sub_db;
+ std::unique_ptr<proton::test::DummyDocumentSubDb> sub_db;
MaintenanceDocumentSubDB maintenance_sub_db;
PendingLidTracker _pendingLidsForCommit;
MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo);
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
index 21bd96552b8..a82437012c2 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
@@ -3,7 +3,9 @@
#include "lid_space_jobtest.h"
#include <vespa/searchcore/proton/server/lid_space_compaction_job.h>
#include <vespa/searchcore/proton/server/lid_space_compaction_job_take2.h>
+#include <vespa/searchcore/proton/server/executorthreadingservice.h>
#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
using BlockedReason = IBlockableMaintenanceJob::BlockedReason;
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
index dd2760022c2..a78ad66592f 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
@@ -3,6 +3,7 @@
#include "lid_space_common.h"
#include <vespa/searchcore/proton/server/blockable_maintenance_job.h>
#include <vespa/persistence/spi/bucketexecutor.h>
+#include <vespa/searchcorespi/index/i_thread_service.h>
#include <vespa/vespalib/gtest/gtest.h>
namespace storage::spi::dummy { class DummyBucketExecutor; }
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index f76748dc028..1c2028d344a 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -8,6 +8,7 @@
#include <vespa/searchcore/proton/common/doctypename.h>
#include <vespa/searchcore/proton/common/transient_memory_usage_provider.h>
#include <vespa/searchcore/proton/documentmetastore/operation_listener.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
#include <vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.h>
#include <vespa/searchcore/proton/feedoperation/putoperation.h>
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 6049afbae27..85cd2513c0f 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -194,7 +194,7 @@ IndexManagerTest::resetIndexManager()
{
_index_manager.reset();
_index_manager = std::make_unique<IndexManager>(index_dir, IndexConfig(), getSchema(), 1,
- _reconfigurer, _writeService, _writeService.getMasterExecutor(),
+ _reconfigurer, _writeService, _writeService.master(),
TuneFileIndexManager(), TuneFileAttributes(),_fileHeaderContext);
}
diff --git a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp
index e87f74e2258..9f6bd140e54 100644
--- a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp
@@ -34,6 +34,7 @@ IndexManagerInitializer(const vespalib::string &baseDir,
{
}
+IndexManagerInitializer::~IndexManagerInitializer() = default;
void
IndexManagerInitializer::run()
diff --git a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h
index 8e446e222b3..c3f01ed8420 100644
--- a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h
+++ b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h
@@ -38,6 +38,7 @@ public:
const search::TuneFileAttributes & tuneFileAttributes,
const search::common::FileHeaderContext & fileHeaderContext,
std::shared_ptr<searchcorespi::IIndexManager::SP> indexManager);
+ ~IndexManagerInitializer() override;
void run() override;
};
diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
index 7cf25292d1c..f74b9074a44 100644
--- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
+++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
@@ -77,7 +77,7 @@ public:
const search::TuneFileIndexManager &tuneFileIndexManager,
const search::TuneFileAttributes &tuneFileAttributes,
const search::common::FileHeaderContext &fileHeaderContext);
- ~IndexManager();
+ ~IndexManager() override;
searchcorespi::index::IndexMaintainer &getMaintainer() {
return _maintainer;
diff --git a/searchcore/src/vespa/searchcore/proton/server/bucketmovejobv2.cpp b/searchcore/src/vespa/searchcore/proton/server/bucketmovejobv2.cpp
index 5be7f5fed0c..84b693db4ba 100644
--- a/searchcore/src/vespa/searchcore/proton/server/bucketmovejobv2.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/bucketmovejobv2.cpp
@@ -9,7 +9,7 @@
#include "ibucketmodifiedhandler.h"
#include "move_operation_limiter.h"
#include "document_db_maintenance_config.h"
-#include "document_db_explorer.h"
+#include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h>
#include <vespa/searchcore/proton/bucketdb/i_bucket_create_notifier.h>
#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
#include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.cpp b/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.cpp
index a5c3e8d6078..6fdf5660d06 100644
--- a/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.cpp
@@ -5,6 +5,7 @@
#include "document_subdb_collection_explorer.h"
#include "executor_threading_service_explorer.h"
#include "maintenance_controller_explorer.h"
+#include "documentdb.h"
#include <vespa/searchcore/proton/bucketdb/bucket_db_explorer.h>
#include <vespa/searchcore/proton/common/state_reporter_utils.h>
#include <vespa/searchcore/proton/matching/session_manager_explorer.h>
@@ -15,12 +16,12 @@ using namespace vespalib::slime;
namespace proton {
-DocumentDBExplorer::DocumentDBExplorer(const DocumentDB::SP &docDb)
- : _docDb(docDb)
+DocumentDBExplorer::DocumentDBExplorer(std::shared_ptr<DocumentDB> docDb)
+ : _docDb(std::move(docDb))
{
}
-DocumentDBExplorer::~DocumentDBExplorer() {}
+DocumentDBExplorer::~DocumentDBExplorer() = default;
void
DocumentDBExplorer::get_state(const Inserter &inserter, bool full) const
diff --git a/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.h b/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.h
index b69c66ec7ad..22004769815 100644
--- a/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.h
+++ b/searchcore/src/vespa/searchcore/proton/server/document_db_explorer.h
@@ -2,22 +2,23 @@
#pragma once
-#include "documentdb.h"
#include <vespa/vespalib/net/state_explorer.h>
namespace proton {
+class DocumentDB;
+
/**
* Class used to explore the state of a document database and its components.
*/
class DocumentDBExplorer : public vespalib::StateExplorer
{
private:
- DocumentDB::SP _docDb;
+ std::shared_ptr<DocumentDB> _docDb;
public:
- DocumentDBExplorer(const DocumentDB::SP &docDb);
- ~DocumentDBExplorer();
+ DocumentDBExplorer(std::shared_ptr<DocumentDB> docDb);
+ ~DocumentDBExplorer() override;
void get_state(const vespalib::slime::Inserter &inserter, bool full) const override;
std::vector<vespalib::string> get_children_names() const override;
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index 4a66a7caab4..09790fd84b9 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -9,6 +9,7 @@
#include <vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h>
#include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h>
#include <vespa/vespalib/util/lambdatask.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
using proton::matching::SessionManager;
using search::GrowStrategy;
diff --git a/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.cpp b/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.cpp
index bbb87099988..81734f681fd 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.cpp
@@ -4,12 +4,11 @@
#include <vespa/vespalib/data/slime/cursor.h>
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
#include <vespa/vespalib/util/singleexecutor.h>
-#include <vespa/vespalib/util/threadexecutor.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
using vespalib::BlockingThreadStackExecutor;
using vespalib::SingleExecutor;
-using vespalib::SyncableThreadExecutor;
+using vespalib::ThreadExecutor;
using vespalib::ThreadStackExecutor;
using vespalib::slime::Cursor;
@@ -19,7 +18,7 @@ namespace proton::explorer {
namespace {
void
-convert_syncable_executor_to_slime(const SyncableThreadExecutor& executor, const vespalib::string& type, Cursor& object)
+convert_syncable_executor_to_slime(const ThreadExecutor& executor, const vespalib::string& type, Cursor& object)
{
object.setString("type", type);
object.setLong("num_threads", executor.getNumThreads());
@@ -37,7 +36,7 @@ convert_single_executor_to_slime(const SingleExecutor& executor, Cursor& object)
}
void
-convert_executor_to_slime(const SyncableThreadExecutor* executor, Cursor& object)
+convert_executor_to_slime(const ThreadExecutor* executor, Cursor& object)
{
if (executor == nullptr) {
return;
@@ -49,7 +48,7 @@ convert_executor_to_slime(const SyncableThreadExecutor* executor, Cursor& object
} else if (const auto* thread = dynamic_cast<const ThreadStackExecutor*>(executor)) {
convert_syncable_executor_to_slime(*thread, "ThreadStackExecutor", object);
} else {
- convert_syncable_executor_to_slime(*executor, "SyncableThreadExecutor", object);
+ convert_syncable_executor_to_slime(*executor, "ThreadExecutor", object);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.h b/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.h
index 0793fa6ac4a..6bf70ef4889 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executor_explorer_utils.h
@@ -2,7 +2,7 @@
#pragma once
-namespace vespalib { class SyncableThreadExecutor; }
+namespace vespalib { class ThreadExecutor; }
namespace vespalib::slime { struct Cursor; }
namespace proton::explorer {
@@ -10,7 +10,7 @@ namespace proton::explorer {
/**
* Utility to convert an executor to slime for use with a state explorer.
*/
-void convert_executor_to_slime(const vespalib::SyncableThreadExecutor* executor, vespalib::slime::Cursor& object);
+void convert_executor_to_slime(const vespalib::ThreadExecutor* executor, vespalib::slime::Cursor& object);
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
index 80c1288903e..ab1642bdc2a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
@@ -7,7 +7,6 @@
#include <vespa/vespalib/util/singleexecutor.h>
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
-
using vespalib::SyncableThreadExecutor;
using vespalib::BlockingThreadStackExecutor;
using vespalib::SingleExecutor;
@@ -37,11 +36,11 @@ VESPA_THREAD_STACK_TAG(attribute_executor)
}
-ExecutorThreadingService::ExecutorThreadingService(vespalib::SyncableThreadExecutor &sharedExecutor, uint32_t num_treads)
+ExecutorThreadingService::ExecutorThreadingService(vespalib::ThreadExecutor &sharedExecutor, uint32_t num_treads)
: ExecutorThreadingService(sharedExecutor, ThreadingServiceConfig::make(num_treads))
{}
-ExecutorThreadingService::ExecutorThreadingService(vespalib::SyncableThreadExecutor & sharedExecutor,
+ExecutorThreadingService::ExecutorThreadingService(vespalib::ThreadExecutor & sharedExecutor,
const ThreadingServiceConfig & cfg, uint32_t stackSize)
: _sharedExecutor(sharedExecutor),
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
index 1561f5d6adc..7e943689012 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
@@ -17,7 +17,7 @@ class ThreadingServiceConfig;
class ExecutorThreadingService : public searchcorespi::index::IThreadingService
{
private:
- vespalib::SyncableThreadExecutor & _sharedExecutor;
+ vespalib::ThreadExecutor & _sharedExecutor;
vespalib::ThreadStackExecutor _masterExecutor;
std::unique_ptr<vespalib::SyncableThreadExecutor> _indexExecutor;
std::unique_ptr<vespalib::SyncableThreadExecutor> _summaryExecutor;
@@ -37,9 +37,9 @@ public:
* @stackSize The size of the stack of the underlying executors.
* @cfg config used to set up all executors.
*/
- ExecutorThreadingService(vespalib::SyncableThreadExecutor &sharedExecutor,
+ ExecutorThreadingService(vespalib::ThreadExecutor &sharedExecutor,
const ThreadingServiceConfig & cfg, uint32_t stackSize = 128 * 1024);
- ExecutorThreadingService(vespalib::SyncableThreadExecutor &sharedExecutor, uint32_t num_treads = 1);
+ ExecutorThreadingService(vespalib::ThreadExecutor &sharedExecutor, uint32_t num_treads = 1);
~ExecutorThreadingService() override;
/**
@@ -52,13 +52,14 @@ public:
void setTaskLimit(uint32_t taskLimit, uint32_t summaryTaskLimit);
// Expose the underlying executors for stats fetching and testing.
- vespalib::ThreadStackExecutorBase &getMasterExecutor() {
+ // TOD: Remove - This is only used for casting to check the underlying type
+ vespalib::ThreadExecutor &getMasterExecutor() {
return _masterExecutor;
}
- vespalib::SyncableThreadExecutor &getIndexExecutor() {
+ vespalib::ThreadExecutor &getIndexExecutor() {
return *_indexExecutor;
}
- vespalib::SyncableThreadExecutor &getSummaryExecutor() {
+ vespalib::ThreadExecutor &getSummaryExecutor() {
return *_summaryExecutor;
}
@@ -75,7 +76,7 @@ public:
searchcorespi::index::IThreadService &summary() override {
return _summaryService;
}
- vespalib::SyncableThreadExecutor &shared() override {
+ vespalib::ThreadExecutor &shared() override {
return _sharedExecutor;
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
index 12d9d24b525..1b9e18961f6 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include "executorthreadingservice.h"
#include "fast_access_doc_subdb.h"
#include "searchable_doc_subdb_configurer.h"
#include "searchable_feed_view.h"
diff --git a/searchcore/src/vespa/searchcore/proton/test/test.h b/searchcore/src/vespa/searchcore/proton/test/test.h
index 92443c813ad..f82ffe73795 100644
--- a/searchcore/src/vespa/searchcore/proton/test/test.h
+++ b/searchcore/src/vespa/searchcore/proton/test/test.h
@@ -6,7 +6,6 @@
#include "bucketstatecalculator.h"
#include "document.h"
#include "dummy_document_store.h"
-#include "dummy_document_sub_db.h"
#include "dummy_feed_view.h"
#include "dummy_summary_manager.h"
#include "resulthandler.h"