diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-12-09 14:26:59 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-12-09 14:26:59 +0000 |
commit | 136e428e41823454c7f09044277db05ea96168b3 (patch) | |
tree | 5cd5c3306dc886e755c60b5a0be2514e13e17662 /document | |
parent | 0f15b405cad738460a8126bf9ef689ec3edfd094 (diff) |
Propagate doc repo in update to auto-created blank document instance
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/update/documentupdate.cpp | 5 | ||||
-rw-r--r-- | document/src/vespa/document/update/documentupdate.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index 7a3eb85d3d5..d6488c1381c 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -91,6 +91,11 @@ DocumentUpdate::getType() const { return static_cast<const DocumentType &> (*_type); } +const DocumentTypeRepo* +DocumentUpdate::getRepoPtr() const noexcept { + return _repo; +} + const DocumentUpdate::FieldUpdateV & DocumentUpdate::getUpdates() const { ensureDeserialized(); diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index 192569ba6ee..5a7944b1188 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -60,7 +60,7 @@ public: * The document type is not strictly needed, as we know this at applyTo() * time, but search does not use applyTo() code to do the update, and don't * know the document type of their objects, so this is supplied for - * convinience. It also makes it possible to check updates for sanity at + * convenience. It also makes it possible to check updates for sanity at * creation time. * * @param type The document type that this update is applicable for. @@ -101,6 +101,9 @@ public: /** @return The type of document this update is for. */ const DocumentType& getType() const; + // Returns pointer to repo used for underlying update, or nullptr if default-constructed + const DocumentTypeRepo* getRepoPtr() const noexcept; + void serializeHEAD(vespalib::nbostream &stream) const; /** |