summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-06-14 09:37:36 +0200
committerGitHub <noreply@github.com>2018-06-14 09:37:36 +0200
commit3302fb4a790925ad0437d2bd7b4747c4d02a971b (patch)
treeb4299bc5f651565a86180d0389eef9df4bbdbbbc /searchcore
parentf562d35d3636cfbb6fd6d9caeb94d97dcdfc0f8e (diff)
parent747bda75a444c866d8e4752315e6949fd23194bd (diff)
Merge pull request #6185 from vespa-engine/balder/balder/prepare-lazy-deserialize-rebased-2
Balder/balder/prepare lazy deserialize rebased 2
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp11
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp2
-rw-r--r--searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp5
-rw-r--r--searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp4
-rw-r--r--searchcore/src/tests/proton/server/feedstates_test.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/compact_lid_space_operation.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/feedoperation.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h29
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/removedocumentsoperation.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.cpp22
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.h17
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp22
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp13
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h9
-rw-r--r--searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h13
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedstate.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedstates.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedstates.h24
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h22
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h5
37 files changed, 147 insertions, 145 deletions
diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
index 17f1faffbba..8ffe4807427 100644
--- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
+++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
@@ -1,8 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/config/helper/configgetter.h>
-
#include <vespa/searchcore/proton/server/replaypacketdispatcher.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchlib/common/fileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogclient.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index c41b6bdcb97..0e6bd2c74fe 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -445,7 +445,7 @@ TEST_F("require that attribute writer handles update", Fixture)
schema.addAttributeField(Schema::AttributeField("a2", schema::DataType::INT32, CollectionType::SINGLE));
DocBuilder idb(schema);
const document::DocumentType &dt(idb.getDocumentType());
- DocumentUpdate upd(dt, DocumentId("doc::1"));
+ DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("doc::1"));
upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 5)));
upd.addUpdate(FieldUpdate(upd.getType().getField("a2"))
@@ -489,7 +489,7 @@ TEST_F("require that attribute writer handles predicate update", Fixture)
EXPECT_EQUAL(2u, a1->getNumDocs());
const document::DocumentType &dt(idb.getDocumentType());
- DocumentUpdate upd(dt, DocumentId("doc::1"));
+ DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("doc::1"));
PredicateFieldValue new_value(builder.feature("foo").value("bar").build());
upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
.addUpdate(AssignValueUpdate(new_value)));
@@ -678,7 +678,7 @@ TEST_F("require that attribute writer handles tensor assign update", Fixture)
EXPECT_TRUE(tensor->equals(*tensor2));
const document::DocumentType &dt(builder.getDocumentType());
- DocumentUpdate upd(dt, DocumentId("doc::1"));
+ DocumentUpdate upd(*builder.getDocumentTypeRepo(), dt, DocumentId("doc::1"));
auto new_tensor = createTensor({ {{{"x", "8"}, {"y", "9"}}, 11} },
{"x", "y"});
TensorFieldValue new_value;
diff --git a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
index f06bb124eb8..958be6a4686 100644
--- a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp
@@ -1,15 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("combiningfeedview_test");
#include <vespa/document/test/make_bucket_space.h>
-#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/server/combiningfeedview.h>
#include <vespa/searchcore/proton/test/test.h>
#include <vespa/searchlib/common/idestructorcallback.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("combiningfeedview_test");
+
using document::DocumentTypeRepo;
using document::DocumentUpdate;
using document::test::makeBucketSpace;
@@ -22,8 +23,8 @@ typedef std::vector<IFeedView::SP> FeedViewVector;
struct MyStreamHandler : public NewConfigOperation::IStreamHandler
{
- virtual void serializeConfig(SerialNum, vespalib::nbostream &) override {}
- virtual void deserializeConfig(SerialNum, vespalib::nbostream &) override {}
+ void serializeConfig(SerialNum, vespalib::nbostream &) override {}
+ void deserializeConfig(SerialNum, vespalib::nbostream &) override {}
};
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 bab6aff821f..760f7457d33 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
@@ -14,6 +14,7 @@
#include <vespa/searchcore/proton/reference/i_document_db_reference_resolver.h>
#include <vespa/searchcore/proton/reprocessing/i_reprocessing_task.h>
#include <vespa/searchcore/proton/reprocessing/reprocessingrunner.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/server/bootstrapconfig.h>
#include <vespa/searchcore/proton/server/document_subdb_explorer.h>
#include <vespa/searchcore/proton/server/emptysearchview.h>
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index e774728b41e..a1bce7174bf 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -316,7 +316,7 @@ struct UpdateContext {
DocumentUpdate::SP update;
BucketId bucketId;
UpdateContext(const vespalib::string &docId, DocBuilder &builder) :
- update(new DocumentUpdate(builder.getDocumentType(), DocumentId(docId))),
+ update(new DocumentUpdate(*builder.getDocumentTypeRepo(), builder.getDocumentType(), DocumentId(docId))),
bucketId(BucketFactory::getBucketId(update->getId()))
{
}
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index a9fa79f513c..d21e5abe30b 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -11,6 +11,7 @@
#include <vespa/searchcore/proton/server/isummaryadapter.h>
#include <vespa/searchcore/proton/server/matchview.h>
#include <vespa/searchcore/proton/server/searchable_feed_view.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/test/document_meta_store_context_observer.h>
#include <vespa/searchcore/proton/test/dummy_document_store.h>
#include <vespa/searchcore/proton/test/dummy_summary_manager.h>
@@ -478,11 +479,11 @@ struct DocumentContext
DocumentContext::DocumentContext(const vespalib::string &docId, uint64_t timestamp, DocBuilder &builder)
: doc(builder.startDocument(docId).startSummaryField("s1").addStr(docId).endField().endDocument().release()),
- upd(new DocumentUpdate(builder.getDocumentType(), doc->getId())),
+ upd(new DocumentUpdate(*builder.getDocumentTypeRepo(), builder.getDocumentType(), doc->getId())),
bid(BucketFactory::getNumBucketBits(), doc->getId().getGlobalId().convertToBucketId().getRawId()),
ts(timestamp)
{}
-DocumentContext::~DocumentContext() {}
+DocumentContext::~DocumentContext() = default;
struct FeedTokenContext
{
diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
index e8247a52199..d07c29ead69 100644
--- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
@@ -9,6 +9,8 @@
#include <vespa/searchcore/proton/server/putdonecontext.h>
#include <vespa/searchcore/proton/server/removedonecontext.h>
#include <vespa/searchcore/proton/server/storeonlyfeedview.h>
+#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
+#include <vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.h>
#include <vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h>
#include <vespa/searchcore/proton/test/mock_summary_adapter.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
index 9a9d896f2b9..e87e9209a17 100644
--- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
@@ -122,7 +122,7 @@ public:
}
auto makeUpdate() {
- auto upd(std::make_shared<DocumentUpdate>(_docType, docId));
+ auto upd(std::make_shared<DocumentUpdate>(*_repo, _docType, docId));
upd->addUpdate(FieldUpdate(upd->getType().getField("string")).
addUpdate(AssignValueUpdate(StringFieldValue("newval"))));
return upd;
@@ -136,6 +136,7 @@ public:
TEST("require that toString() on derived classes are meaningful")
{
+ DocumentTypeRepo repo;
BucketId bucket_id1(42);
BucketId bucket_id2(43);
BucketId bucket_id3(44);
@@ -146,7 +147,7 @@ TEST("require that toString() on derived classes are meaningful")
MyStreamHandler stream_handler;
DocumentIdT doc_id_limit = 15;
DocumentId doc_id("doc:foo:bar");
- DocumentUpdate::SP update(new DocumentUpdate(*DataType::DOCUMENT, doc_id));
+ DocumentUpdate::SP update(new DocumentUpdate(repo, *DataType::DOCUMENT, doc_id));
EXPECT_EQUAL("DeleteBucket(BucketId(0x0000000000000000), serialNum=0)",
DeleteBucketOperation().toString());
diff --git a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
index 73580416e65..7f065d0cc15 100644
--- a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
+++ b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
@@ -67,7 +67,9 @@ createDoc(const DocumentType &docType, const DocumentId &docId)
document::DocumentUpdate::SP
createUpd(const DocumentType& docType, const DocumentId &docId)
{
- return document::DocumentUpdate::SP(new document::DocumentUpdate(docType, docId));
+ static std::vector<std::unique_ptr<document::DocumentTypeRepo>> repoList;
+ repoList.emplace_back(std::make_unique<document::DocumentTypeRepo>(docType));
+ return std::make_shared<document::DocumentUpdate>(*repoList.back(), docType, docId);
}
storage::spi::ClusterState
diff --git a/searchcore/src/tests/proton/server/feedstates_test.cpp b/searchcore/src/tests/proton/server/feedstates_test.cpp
index dfa461e2b57..f206ffc9b17 100644
--- a/searchcore/src/tests/proton/server/feedstates_test.cpp
+++ b/searchcore/src/tests/proton/server/feedstates_test.cpp
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for feedstates.
-#include <vespa/log/log.h>
-LOG_SETUP("feedstates_test");
#include <vespa/document/base/documentid.h>
#include <vespa/document/base/testdocrepo.h>
@@ -11,6 +9,7 @@ LOG_SETUP("feedstates_test");
#include <vespa/searchcore/proton/server/feedstates.h>
#include <vespa/searchcore/proton/server/ireplayconfig.h>
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
+#include <vespa/searchcore/proton/feedoperation/removeoperation.h>
#include <vespa/searchcore/proton/test/dummy_feed_view.h>
#include <vespa/searchlib/common/serialnum.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -18,6 +17,9 @@ LOG_SETUP("feedstates_test");
#include <vespa/vespalib/util/buffer.h>
#include <vespa/searchcore/proton/bucketdb/bucketdbhandler.h>
+#include <vespa/log/log.h>
+LOG_SETUP("feedstates_test");
+
using document::BucketId;
using document::DocumentId;
using document::DocumentTypeRepo;
@@ -83,7 +85,7 @@ Fixture::Fixture()
state("doctypename", feed_view_ptr, _bucketDBHandler, replay_config, config_store)
{
}
-Fixture::~Fixture() {}
+Fixture::~Fixture() = default;
struct RemoveOperationContext
@@ -107,7 +109,7 @@ RemoveOperationContext::RemoveOperationContext(search::SerialNum serial)
packet.reset(new Packet());
packet->add(Packet::Entry(serial, FeedOperation::REMOVE, buf));
}
-RemoveOperationContext::~RemoveOperationContext() {}
+RemoveOperationContext::~RemoveOperationContext() = default;
TEST_F("require that active FeedView can change during replay", Fixture)
{
RemoveOperationContext opCtx(10);
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/compact_lid_space_operation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/compact_lid_space_operation.cpp
index cd906891b92..c2a3439388a 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/compact_lid_space_operation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/compact_lid_space_operation.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "compact_lid_space_operation.h"
+#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/stringfmt.h>
namespace proton {
@@ -27,8 +28,7 @@ CompactLidSpaceOperation::serialize(vespalib::nbostream& os) const
}
void
-CompactLidSpaceOperation::deserialize(vespalib::nbostream& is,
- const document::DocumentTypeRepo&)
+CompactLidSpaceOperation::deserialize(vespalib::nbostream& is, const document::DocumentTypeRepo&)
{
is >> _subDbId;
is >> _lidLimit;
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/feedoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/feedoperation.h
index 8a00c739126..77b95547bd0 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/feedoperation.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/feedoperation.h
@@ -2,10 +2,10 @@
#pragma once
#include <vespa/searchlib/common/serialnum.h>
-#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/stllike/string.h>
namespace document { class DocumentTypeRepo; }
-
+namespace vespalib { class nbostream; }
namespace proton {
class FeedOperation
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.cpp
index 71a701bdb40..67e4d1b4287 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.cpp
@@ -2,6 +2,7 @@
#include "lidvectorcontext.h"
#include <vespa/searchlib/common/bitvector.h>
+#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.feedoperation.lidvectorcontext");
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.h b/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.h
index b432bbcf20a..b307e50da0a 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/lidvectorcontext.h
@@ -2,9 +2,10 @@
#pragma once
#include <vespa/searchlib/query/base.h>
-#include <vespa/vespalib/objects/nbostream.h>
#include <vector>
+namespace vespalib { class nbostream; }
+
namespace proton {
class LidVectorContext
@@ -29,5 +30,4 @@ public:
size_t getNumLids() const { return _result.size(); }
};
-} // namespace proton
-
+}
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h
index b7b041135d4..144aa534bf7 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h
@@ -2,30 +2,29 @@
#pragma once
#include "feedoperation.h"
-#include <vespa/vespalib/objects/nbostream.h>
namespace proton {
+ namespace feedoperation {
+ struct IStreamHandler {
+ virtual ~IStreamHandler() {}
+ virtual void serializeConfig(search::SerialNum serialNum, vespalib::nbostream &os) = 0;
+ virtual void deserializeConfig(search::SerialNum serialNum, vespalib::nbostream &is) = 0;
+ };
+ }
+
class NewConfigOperation : public FeedOperation
{
public:
- struct IStreamHandler {
- virtual ~IStreamHandler() {}
- virtual void serializeConfig(SerialNum serialNum,
- vespalib::nbostream &os) = 0;
- virtual void deserializeConfig(SerialNum serialNum,
- vespalib::nbostream &is) = 0;
- };
+ using IStreamHandler = feedoperation::IStreamHandler;
private:
IStreamHandler &_streamHandler;
public:
- NewConfigOperation(SerialNum serialNum,
- IStreamHandler &streamHandler);
- virtual ~NewConfigOperation() {}
- virtual void serialize(vespalib::nbostream &os) const override;
- virtual void deserialize(vespalib::nbostream &is,
- const document::DocumentTypeRepo &repo) override;
- virtual vespalib::string toString() const override;
+ NewConfigOperation(SerialNum serialNum, IStreamHandler &streamHandler);
+ ~NewConfigOperation() override {}
+ void serialize(vespalib::nbostream &os) const override;
+ void deserialize(vespalib::nbostream &is, const document::DocumentTypeRepo &repo) override;
+ vespalib::string toString() const override;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.cpp
index eea693e4680..69f754cd594 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.cpp
@@ -2,6 +2,7 @@
#include "pruneremoveddocumentsoperation.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/objects/nbostream.h>
#include <cassert>
#include <vespa/log/log.h>
@@ -22,8 +23,7 @@ PruneRemovedDocumentsOperation::PruneRemovedDocumentsOperation()
PruneRemovedDocumentsOperation::
-PruneRemovedDocumentsOperation(DocumentIdT docIdLimit,
- uint32_t subDbId)
+PruneRemovedDocumentsOperation(DocumentIdT docIdLimit, uint32_t subDbId)
: RemoveDocumentsOperation(FeedOperation::PRUNE_REMOVED_DOCUMENTS),
_subDbId(subDbId)
{
@@ -44,8 +44,7 @@ PruneRemovedDocumentsOperation::serialize(vespalib::nbostream &os) const
void
-PruneRemovedDocumentsOperation::deserialize(vespalib::nbostream &is,
- const DocumentTypeRepo &)
+PruneRemovedDocumentsOperation::deserialize(vespalib::nbostream &is, const DocumentTypeRepo &)
{
is >> _subDbId;
deserializeLidsToRemove(is);
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/removedocumentsoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/removedocumentsoperation.cpp
index 6aa479611d1..ef482a19ca3 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/removedocumentsoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/removedocumentsoperation.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "removedocumentsoperation.h"
+#include <vespa/vespalib/objects/nbostream.h>
namespace proton {
@@ -16,11 +17,9 @@ RemoveDocumentsOperation::serializeLidsToRemove(vespalib::nbostream &os) const
{
uint32_t mapSize = _lidsToRemoveMap.size();
os << mapSize;
- for (LidsToRemoveMap::const_iterator
- it = _lidsToRemoveMap.begin(), ite = _lidsToRemoveMap.end();
- it != ite; ++it) {
- os << it->first;
- it->second->serialize(os);
+ for (const auto & entry : _lidsToRemoveMap) {
+ os << entry.first;
+ entry.second->serialize(os);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.cpp
index f3ef73f4d90..16ddedc4745 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "spoolerreplayoperation.h"
+#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/stringfmt.h>
using vespalib::make_string;
@@ -14,10 +15,7 @@ SpoolerReplayOperation::SpoolerReplayOperation(Type type)
{
}
-
-SpoolerReplayOperation::SpoolerReplayOperation(Type type,
- SerialNum serialNum,
- SerialNum spoolerSerialNum)
+SpoolerReplayOperation::SpoolerReplayOperation(Type type, SerialNum serialNum, SerialNum spoolerSerialNum)
: FeedOperation(type),
_spoolerSerialNum(spoolerSerialNum)
{
@@ -39,11 +37,8 @@ SpoolerReplayOperation::deserialize(vespalib::nbostream &is)
}
vespalib::string SpoolerReplayOperation::toString() const {
- return make_string(
- "SpoolerReplay%s(spoolerSerialNum=%" PRIu64
- ", serialNum=%" PRIu64 ")",
- getType() == SPOOLER_REPLAY_START ? "Start" : "Complete",
- _spoolerSerialNum, getSerialNum());
+ return make_string("SpoolerReplay%s(spoolerSerialNum=%" PRIu64", serialNum=%" PRIu64 ")",
+ getType() == SPOOLER_REPLAY_START ? "Start" : "Complete", _spoolerSerialNum, getSerialNum());
}
@@ -53,8 +48,7 @@ SpoolerReplayStartOperation::SpoolerReplayStartOperation()
}
-SpoolerReplayStartOperation::SpoolerReplayStartOperation(SerialNum serialNum,
- SerialNum spoolerSerialNum)
+SpoolerReplayStartOperation::SpoolerReplayStartOperation(SerialNum serialNum, SerialNum spoolerSerialNum)
: SpoolerReplayOperation(FeedOperation::SPOOLER_REPLAY_START,
serialNum,
spoolerSerialNum)
@@ -70,12 +64,8 @@ SpoolerReplayCompleteOperation::SpoolerReplayCompleteOperation()
SpoolerReplayCompleteOperation::SpoolerReplayCompleteOperation(SerialNum serialNum,
SerialNum spoolerSerialNum)
- : SpoolerReplayOperation(FeedOperation::SPOOLER_REPLAY_COMPLETE,
- serialNum,
- spoolerSerialNum)
+ : SpoolerReplayOperation(FeedOperation::SPOOLER_REPLAY_COMPLETE, serialNum, spoolerSerialNum)
{
}
-
-
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.h
index 028d01dec20..028ad1c6bfa 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/spoolerreplayoperation.h
@@ -11,15 +11,12 @@ private:
SerialNum _spoolerSerialNum;
protected:
SpoolerReplayOperation(Type type);
- SpoolerReplayOperation(Type type,
- SerialNum serialNum,
- SerialNum spoolerSerialNum);
+ SpoolerReplayOperation(Type type, SerialNum serialNum, SerialNum spoolerSerialNum);
public:
- virtual ~SpoolerReplayOperation() {}
+ ~SpoolerReplayOperation() override {}
SerialNum getSpoolerSerialNum() const { return _spoolerSerialNum; }
- virtual void serialize(vespalib::nbostream &os) const override;
- virtual void deserialize(vespalib::nbostream &is,
- const document::DocumentTypeRepo &) override {
+ void serialize(vespalib::nbostream &os) const override;
+ void deserialize(vespalib::nbostream &is, const document::DocumentTypeRepo &) override {
deserialize(is);
}
void deserialize(vespalib::nbostream &is);
@@ -38,8 +35,7 @@ public:
* @param serialNum the current serial number of the transaction log.
* @param spoolerSerialNum the serial number of the first entry of the spooler log replay.
*/
- SpoolerReplayStartOperation(SerialNum serialNum,
- SerialNum spoolerSerialNum);
+ SpoolerReplayStartOperation(SerialNum serialNum, SerialNum spoolerSerialNum);
};
@@ -54,8 +50,7 @@ public:
* @param serialNum the current serial number of the transaction log.
* @param spoolerSerialNum the serial number of the last entry of the spooler log replay.
*/
- SpoolerReplayCompleteOperation(SerialNum serialNum,
- SerialNum spoolerSerialNum);
+ SpoolerReplayCompleteOperation(SerialNum serialNum, SerialNum spoolerSerialNum);
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp
index d31f1faec77..dc83848152c 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp
@@ -51,12 +51,11 @@ UpdateOperation::serializeUpdate(vespalib::nbostream &os) const
}
void
-UpdateOperation::deserializeUpdate(vespalib::nbostream &is, const document::DocumentTypeRepo &repo)
+UpdateOperation::deserializeUpdate(vespalib::nbostream && is, const document::DocumentTypeRepo &repo)
{
- document::ByteBuffer buf(is.peek(), is.size());
- DocumentUpdate::UP update = (getType() == UPDATE_42) ? DocumentUpdate::create42(repo, buf) : DocumentUpdate::createHEAD(repo, buf);
- is.adjustReadPos(buf.getPos());
- _upd = std::move(update);
+ _upd = (getType() == UPDATE_42)
+ ? DocumentUpdate::create42(repo, is)
+ : DocumentUpdate::createHEAD(repo, std::move(is));
}
void
@@ -73,7 +72,7 @@ UpdateOperation::deserialize(vespalib::nbostream &is, const DocumentTypeRepo &re
{
DocumentOperation::deserialize(is, repo);
try {
- deserializeUpdate(is, repo);
+ deserializeUpdate(std::move(is), repo);
} catch (document::DocumentTypeNotFoundException &e) {
LOG(warning, "Failed deserialize update operation using unknown document type '%s'",
e.getDocumentTypeName().c_str());
@@ -83,18 +82,19 @@ UpdateOperation::deserialize(vespalib::nbostream &is, const DocumentTypeRepo &re
}
void
-UpdateOperation::deserializeUpdate(const DocumentTypeRepo &repo)
+UpdateOperation::verifyUpdate(const DocumentTypeRepo &repo)
{
vespalib::nbostream stream;
serializeUpdate(stream);
- deserializeUpdate(stream, repo);
+ deserializeUpdate(std::move(stream), repo);
+ _upd->eagerDeserialize(); // Will trigger exceptions if incompatible
}
-vespalib::string UpdateOperation::toString() const {
+vespalib::string
+UpdateOperation::toString() const {
return make_string("%s(%s, %s)",
((getType() == FeedOperation::UPDATE_42) ? "Update42" : "Update"),
- _upd.get() ?
- _upd->getId().getScheme().toString().c_str() : "NULL",
+ _upd.get() ? _upd->getId().getScheme().toString().c_str() : "NULL",
docArgsToString().c_str());
}
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.h
index 99dcbfbce6c..83e87fea096 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.h
@@ -19,7 +19,7 @@ private:
const storage::spi::Timestamp &timestamp,
const DocumentUpdateSP &upd);
void serializeUpdate(vespalib::nbostream &os) const;
- void deserializeUpdate(vespalib::nbostream &is, const document::DocumentTypeRepo &repo);
+ void deserializeUpdate(vespalib::nbostream && is, const document::DocumentTypeRepo &repo);
public:
UpdateOperation();
UpdateOperation(Type type);
@@ -30,7 +30,7 @@ public:
const DocumentUpdateSP &getUpdate() const { return _upd; }
void serialize(vespalib::nbostream &os) const override;
void deserialize(vespalib::nbostream &is, const document::DocumentTypeRepo &repo) override;
- void deserializeUpdate(const document::DocumentTypeRepo &repo);
+ void verifyUpdate(const document::DocumentTypeRepo &repo);
vespalib::string toString() const override;
};
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp
index d7f38a0cc52..c5e6acd80ed 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "wipehistoryoperation.h"
+#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/stringfmt.h>
using vespalib::make_string;
@@ -9,29 +10,29 @@ namespace proton {
WipeHistoryOperation::WipeHistoryOperation()
: FeedOperation(FeedOperation::WIPE_HISTORY),
- _wipeTimeLimit(0) {
+ _wipeTimeLimit(0)
+{
}
WipeHistoryOperation::WipeHistoryOperation(SerialNum serialNum,
fastos::TimeStamp wipeTimeLimit)
: FeedOperation(FeedOperation::WIPE_HISTORY),
- _wipeTimeLimit(wipeTimeLimit) {
+ _wipeTimeLimit(wipeTimeLimit)
+{
setSerialNum(serialNum);
}
void WipeHistoryOperation::serialize(vespalib::nbostream &str) const {
str << _wipeTimeLimit;
}
-void WipeHistoryOperation::deserialize(vespalib::nbostream &str,
- const document::DocumentTypeRepo &) {
+void WipeHistoryOperation::deserialize(vespalib::nbostream &str, const document::DocumentTypeRepo &) {
fastos::TimeStamp::TimeT t;
str >> t;
_wipeTimeLimit = t;
}
vespalib::string WipeHistoryOperation::toString() const {
- return make_string("WipeHistory(wipeTimeLimit=%" PRIu64
- ", serialNum=%" PRIu64 ")",
+ return make_string("WipeHistory(wipeTimeLimit=%" PRIu64 ", serialNum=%" PRIu64 ")",
_wipeTimeLimit.ns(), getSerialNum());
}
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h
index 80b551dbd92..0cf7256bf27 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h
@@ -12,14 +12,13 @@ class WipeHistoryOperation : public FeedOperation {
public:
WipeHistoryOperation();
WipeHistoryOperation(SerialNum serialNum, fastos::TimeStamp wipeTimeLimit);
- virtual ~WipeHistoryOperation() {}
+ ~WipeHistoryOperation() override {}
fastos::TimeStamp getWipeTimeLimit() const { return _wipeTimeLimit; }
- virtual void serialize(vespalib::nbostream &str) const override;
- virtual void deserialize(vespalib::nbostream &str,
- const document::DocumentTypeRepo &) override;
- virtual vespalib::string toString() const override;
+ void serialize(vespalib::nbostream &str) const override;
+ void deserialize(vespalib::nbostream &str, const document::DocumentTypeRepo &) override;
+ vespalib::string toString() const override;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp
index bab3494ca5c..f774c953af4 100644
--- a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp
@@ -377,6 +377,7 @@ PersistenceEngine::update(const Bucket& b, Timestamp t, const DocumentUpdate::SP
upd->getId().toString().c_str(), state.message().c_str()));
}
}
+ upd->eagerDeserialize();
std::shared_lock<std::shared_timed_mutex> rguard(_rwMutex);
DocTypeName docType(upd->getType());
LOG(spam, "update(%s, %" PRIu64 ", (\"%s\", \"%s\"), createIfNonExistent='%s')",
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
index 987218beefa..6ed801154d8 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
@@ -3,7 +3,7 @@
#include "combiningfeedview.h"
#include <vespa/document/fieldvalue/document.h>
#include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h>
-#include <vespa/searchcore/proton/feedoperation/moveoperation.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchlib/common/idestructorcallback.h>
#include <vespa/log/log.h>
@@ -13,17 +13,15 @@ using document::DocumentTypeRepo;
using document::DocumentId;
using search::IDestructorCallback;
-namespace proton
-{
+namespace proton {
-namespace
-{
+namespace {
std::shared_ptr<const DocumentTypeRepo>
getRepo(const std::vector<IFeedView::SP> &views)
{
for (const auto &view : views) {
- if (view.get() == NULL)
+ if (view.get() == nullptr)
continue;
return view->getDocumentTypeRepo();
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
index 6644f21a3b7..3546fdbea71 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
@@ -3,21 +3,14 @@
#pragma once
#include "ifeedview.h"
-#include <vespa/searchcore/proton/common/feedtoken.h>
-#include <vespa/searchcore/proton/feedoperation/deletebucketoperation.h>
-#include <vespa/searchcore/proton/feedoperation/joinbucketsoperation.h>
-#include <vespa/searchcore/proton/feedoperation/pruneremoveddocumentsoperation.h>
-#include <vespa/searchcore/proton/feedoperation/putoperation.h>
-#include <vespa/searchcore/proton/feedoperation/removeoperation.h>
-#include <vespa/searchcore/proton/feedoperation/splitbucketoperation.h>
-#include <vespa/searchcore/proton/feedoperation/updateoperation.h>
-#include <vespa/searchcore/proton/feedoperation/createbucketoperation.h>
-#include <vespa/searchlib/common/serialnum.h>
#include "replaypacketdispatcher.h"
#include "ibucketstatecalculator.h"
+#include <vespa/searchcore/proton/common/feedtoken.h>
+#include <vespa/searchlib/common/serialnum.h>
namespace proton {
+class DocumentOperation;
class CombiningFeedView : public IFeedView
{
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index 61ce0e6dc6f..ad7a2d57c89 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -17,6 +17,7 @@
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
#include <vespa/searchcore/proton/common/eventlogger.h>
#include <vespa/searchcore/proton/common/statusreport.h>
+#include <vespa/searchcore/proton/feedoperation/noopoperation.h>
#include <vespa/searchcore/proton/index/index_writer.h>
#include <vespa/searchcore/proton/initializer/task_runner.h>
#include <vespa/searchcore/proton/metrics/attribute_metrics_collection.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
index 6364e772f94..1c2406b2acf 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
@@ -5,6 +5,7 @@
#include "operationdonecontext.h"
#include "removedonecontext.h"
#include "putdonecontext.h"
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchlib/common/isequencedtaskexecutor.h>
using document::Document;
@@ -71,7 +72,7 @@ FastAccessFeedView::FastAccessFeedView(const StoreOnlyFeedView::Context &storeOn
_docIdLimit(ctx._docIdLimit)
{}
-FastAccessFeedView::~FastAccessFeedView() {}
+FastAccessFeedView::~FastAccessFeedView() = default;
void
FastAccessFeedView::handleCompactLidSpace(const CompactLidSpaceOperation &op)
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
index 66e721f9222..97cc25e635f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
@@ -14,6 +14,7 @@
#include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h>
#include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h>
#include <vespa/searchcore/proton/persistenceengine/transport_latch.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/common/eventlogger.h>
#include <vespa/searchcorespi/index/ithreadingservice.h>
#include <vespa/searchlib/common/gatecallback.h>
@@ -522,7 +523,7 @@ FeedHandler::considerUpdateOperationForRejection(FeedToken &token, UpdateOperati
*/
if (_documentType != &update.getType()) {
try {
- op.deserializeUpdate(*_repo);
+ op.verifyUpdate(*_repo);
} catch (document::FieldNotFoundException &e) {
if (token) {
auto message = make_string("Update operation rejected for document '%s' of type '%s': 'Field not found'",
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstate.h b/searchcore/src/vespa/searchcore/proton/server/feedstate.h
index 472f5cb224f..fa0a1702499 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedstate.h
+++ b/searchcore/src/vespa/searchcore/proton/server/feedstate.h
@@ -25,6 +25,7 @@ private:
Type _type;
protected:
+ using FeedOperationUP = std::unique_ptr<FeedOperation>;
void throwExceptionInReceive(const vespalib::string &docType, uint64_t serialRangeFrom,
uint64_t serialRangeTo, size_t packetSize);
void throwExceptionInHandleOperation(const vespalib::string &docType, const FeedOperation &op);
@@ -38,7 +39,7 @@ public:
Type getType() const { return _type; }
vespalib::string getName() const;
- virtual void handleOperation(FeedToken token, std::unique_ptr<FeedOperation> op) = 0;
+ virtual void handleOperation(FeedToken token, FeedOperationUP op) = 0;
virtual void receive(const PacketWrapper::SP &wrap, vespalib::Executor &executor) = 0;
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
index f0866347f59..ae323bc93df 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
@@ -6,6 +6,7 @@
#include "ireplayconfig.h"
#include "replaypacketdispatcher.h"
#include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchcore/proton/common/eventlogger.h>
#include <vespa/searchlib/common/idestructorcallback.h>
#include <vespa/vespalib/util/closuretask.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstates.h b/searchcore/src/vespa/searchcore/proton/server/feedstates.h
index 963a78d0d6b..a9224669d87 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedstates.h
+++ b/searchcore/src/vespa/searchcore/proton/server/feedstates.h
@@ -28,16 +28,13 @@ public:
{
}
- virtual void handleOperation(FeedToken, FeedOperation::UP op) override {
+ void handleOperation(FeedToken, FeedOperationUP op) override {
throwExceptionInHandleOperation(_doc_type_name, *op);
}
- virtual void
- receive(const PacketWrapper::SP &wrap, vespalib::Executor &) override {
- throwExceptionInReceive(_doc_type_name.c_str(),
- wrap->packet.range().from(),
- wrap->packet.range().to(),
- wrap->packet.size());
+ void receive(const PacketWrapper::SP &wrap, vespalib::Executor &) override {
+ throwExceptionInReceive(_doc_type_name.c_str(), wrap->packet.range().from(),
+ wrap->packet.range().to(), wrap->packet.size());
}
};
@@ -57,12 +54,11 @@ public:
IReplayConfig &replay_config,
FeedConfigStore &config_store);
- virtual void handleOperation(FeedToken, FeedOperation::UP op) override {
+ void handleOperation(FeedToken, FeedOperationUP op) override {
throwExceptionInHandleOperation(_doc_type_name, *op);
}
- virtual void receive(const PacketWrapper::SP &wrap,
- vespalib::Executor &executor) override;
+ void receive(const PacketWrapper::SP &wrap, vespalib::Executor &executor) override;
};
@@ -79,15 +75,13 @@ public:
_handler(handler) {
}
- void handleOperation(FeedToken token, FeedOperation::UP op) override {
+ void handleOperation(FeedToken token, FeedOperationUP op) override {
_handler.performOperation(std::move(token), std::move(op));
}
void receive(const PacketWrapper::SP &wrap, vespalib::Executor &) override {
- throwExceptionInReceive(_handler.getDocTypeName().c_str(),
- wrap->packet.range().from(),
- wrap->packet.range().to(),
- wrap->packet.size());
+ throwExceptionInReceive(_handler.getDocTypeName().c_str(), wrap->packet.range().from(),
+ wrap->packet.range().to(), wrap->packet.size());
}
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h
index 210ece3a36a..e93821e2a36 100644
--- a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h
+++ b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h
@@ -2,10 +2,28 @@
#pragma once
-#include <vespa/searchcore/proton/feedoperation/operations.h>
+namespace document { class DocumentTypeRepo; }
namespace proton {
+class PutOperation;
+class RemoveOperation;
+class UpdateOperation;
+class NoopOperation;
+class NewConfigOperation;
+class WipeHistoryOperation;
+class DeleteBucketOperation;
+class SplitBucketOperation;
+class JoinBucketsOperation;
+class PruneRemovedDocumentsOperation;
+class SpoolerReplayStartOperation;
+class SpoolerReplayCompleteOperation;
+class MoveOperation;
+class CreateBucketOperation;
+class CompactLidSpaceOperation;
+
+namespace feedoperation { class IStreamHandler; }
+
/**
* Interface used to handle the various feed operations during
* replay of the transaction log.
@@ -29,7 +47,7 @@ struct IReplayPacketHandler
virtual void replay(const CreateBucketOperation &op) = 0;
virtual void replay(const CompactLidSpaceOperation &op) = 0;
- virtual NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() = 0;
+ virtual feedoperation::IStreamHandler &getNewConfigStreamHandler() = 0;
virtual const document::DocumentTypeRepo &getDeserializeRepo() = 0;
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp
index cdb42906fc2..42451f08315 100644
--- a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "replaypacketdispatcher.h"
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/document/util/serializableexceptions.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.h b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.h
index fc6f99471d8..771a79ddad9 100644
--- a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.h
+++ b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.h
@@ -7,6 +7,7 @@
namespace proton {
+class FeedOperation;
/**
* Utility class that deserializes packet entries into feed operations
* during replay from the transaction log and dispatches the feed operations
@@ -22,14 +23,11 @@ private:
void replay(OperationType &op, vespalib::nbostream &is, const Packet::Entry &entry);
protected:
- virtual void
- store(const FeedOperation &op);
+ virtual void store(const FeedOperation &op);
public:
ReplayPacketDispatcher(IReplayPacketHandler &handler);
-
- virtual
- ~ReplayPacketDispatcher();
+ virtual ~ReplayPacketDispatcher();
void replayEntry(const Packet::Entry &entry);
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
index 29615b0daf9..22ff1b90de4 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
@@ -13,6 +13,7 @@
#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h>
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h>
#include <vespa/searchcore/proton/attribute/ifieldupdatecallback.h>
+#include <vespa/searchcore/proton/feedoperation/operations.h>
#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/document/datatype/documenttype.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
index 825e14b4368..37f67399f4d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
@@ -13,7 +13,7 @@
#include <vespa/searchcore/proton/common/feeddebugger.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
-#include <vespa/searchcore/proton/feedoperation/feedoperation.h>
+#include <vespa/searchcore/proton/feedoperation/lidvectorcontext.h>
#include <vespa/searchcore/proton/persistenceengine/resulthandler.h>
#include <vespa/searchcore/proton/reference/pending_notify_remove_done.h>
#include <vespa/searchcorespi/index/ithreadingservice.h>
@@ -23,7 +23,6 @@
namespace search { class IDestructorCallback; }
-namespace document { class GLobalId; }
namespace proton {
@@ -35,6 +34,8 @@ class RemoveDoneContext;
class CommitTimeTracker;
class IGidToLidChangeHandler;
class IFieldUpdateCallback;
+class RemoveDocumentsOperation;
+class DocumentOperation;
namespace documentmetastore { class ILidReuseDelayer; }