diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-27 09:53:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-27 09:53:35 +0000 |
commit | 0a5c13aa1ab2117cfb5d70e13313426eb7f1a695 (patch) | |
tree | cd6adb9ea10d1ffd0815268082f414562e9cf7e2 /storageapi | |
parent | c7cb8032b3de3dba59a8462cbf4ab82fc7b93c97 (diff) |
- If document type has been resolved, use if for test-and-set too.
- Inline small frequently called methods.
Diffstat (limited to 'storageapi')
-rw-r--r-- | storageapi/src/vespa/storageapi/message/persistence.cpp | 10 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/message/persistence.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/storageapi/src/vespa/storageapi/message/persistence.cpp b/storageapi/src/vespa/storageapi/message/persistence.cpp index af0b7ae0288..b877a7f29db 100644 --- a/storageapi/src/vespa/storageapi/message/persistence.cpp +++ b/storageapi/src/vespa/storageapi/message/persistence.cpp @@ -43,6 +43,11 @@ PutCommand::getDocumentId() const { return _doc->getId(); } +const document::DocumentType * +PutCommand::getDocumentType() const { + return &_doc->getType(); +} + vespalib::string PutCommand::getSummary() const { @@ -109,6 +114,11 @@ UpdateCommand::UpdateCommand(const document::Bucket &bucket, const document::Doc } } +const document::DocumentType * +UpdateCommand::getDocumentType() const { + return &_update->getType(); +} + UpdateCommand::~UpdateCommand() = default; const document::DocumentId& diff --git a/storageapi/src/vespa/storageapi/message/persistence.h b/storageapi/src/vespa/storageapi/message/persistence.h index 24601803266..309093d64e1 100644 --- a/storageapi/src/vespa/storageapi/message/persistence.h +++ b/storageapi/src/vespa/storageapi/message/persistence.h @@ -34,6 +34,7 @@ public: * Used by test and set to retrieve already existing document */ virtual const document::DocumentId & getDocumentId() const = 0; + virtual const document::DocumentType * getDocumentType() const { return nullptr; } }; /** @@ -64,6 +65,7 @@ public: const DocumentSP& getDocument() const { return _doc; } const document::DocumentId& getDocumentId() const override; Timestamp getTimestamp() const { return _timestamp; } + const document::DocumentType * getDocumentType() const override; vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; @@ -125,6 +127,7 @@ public: Timestamp getTimestamp() const { return _timestamp; } Timestamp getOldTimestamp() const { return _oldTimestamp; } + const document::DocumentType * getDocumentType() const override; vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; |