summaryrefslogtreecommitdiffstats
path: root/persistence
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 07:15:12 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 07:15:12 +0000
commitec0ee281540329b084be424048f56fe4f5bc2087 (patch)
tree46f71963ec57bead083d3364aeac2af564588119 /persistence
parent8e823940929ac0907b3c98e9437b6496ef5d8a6a (diff)
Avoid doing a full get for metadata only get
Diffstat (limited to 'persistence')
-rw-r--r--persistence/src/vespa/persistence/spi/result.cpp4
-rw-r--r--persistence/src/vespa/persistence/spi/result.h12
2 files changed, 10 insertions, 6 deletions
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 {