From ec0ee281540329b084be424048f56fe4f5bc2087 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 4 Aug 2020 07:15:12 +0000 Subject: Avoid doing a full get for metadata only get --- persistence/src/vespa/persistence/spi/result.cpp | 4 ++-- persistence/src/vespa/persistence/spi/result.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'persistence') diff --git a/persistence/src/vespa/persistence/spi/result.cpp b/persistence/src/vespa/persistence/spi/result.cpp index 8de6245a8d2..ccfbd36d630 100644 --- a/persistence/src/vespa/persistence/spi/result.cpp +++ b/persistence/src/vespa/persistence/spi/result.cpp @@ -35,10 +35,10 @@ GetResult::GetResult(Document::UP doc, Timestamp timestamp) { } -GetResult::GetResult(Timestamp removed_at_ts) +GetResult::GetResult(Timestamp removed_at_ts, bool is_tombstone) : _timestamp(removed_at_ts), _doc(), - _is_tombstone(true) + _is_tombstone(is_tombstone) { } diff --git a/persistence/src/vespa/persistence/spi/result.h b/persistence/src/vespa/persistence/spi/result.h index 714d71e37ee..97d1b75a260 100644 --- a/persistence/src/vespa/persistence/spi/result.h +++ b/persistence/src/vespa/persistence/spi/result.h @@ -180,7 +180,11 @@ public: GetResult(DocumentUP doc, Timestamp timestamp); static GetResult make_for_tombstone(Timestamp removed_at_ts) { - return GetResult(removed_at_ts); + return GetResult(removed_at_ts, true); + } + + static GetResult make_for_metadata_only(Timestamp removed_at_ts) { + return GetResult(removed_at_ts, false); } ~GetResult() override; @@ -210,12 +214,12 @@ public: } private: - // Explicitly creates a tombstone (remove entry) GetResult with no document. - explicit GetResult(Timestamp removed_at_ts); + // Explicitly creates a metadata only GetResult with no document, optionally a tombstone (remove entry). + GetResult(Timestamp removed_at_ts, bool is_tombstone); Timestamp _timestamp; DocumentSP _doc; - bool _is_tombstone; + bool _is_tombstone; }; class BucketIdListResult : public Result { -- cgit v1.2.3