aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2021-06-03 10:31:18 +0000
committerGeir Storli <geirst@verizonmedia.com>2021-06-03 10:31:18 +0000
commitd3bdb50bd5f4c2b76c7bdd6e7dd4712013cb710a (patch)
treec283924cc970de0eec16b85c6790bcc8b7ad482e /storageapi
parent6d7ba4368a8d81247fa66bfe60557dadaffb4108 (diff)
Dispatch get and visitor messages to correct distributor stripe.
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/vespa/storageapi/message/visitor.cpp11
-rw-r--r--storageapi/src/vespa/storageapi/message/visitor.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/storageapi/src/vespa/storageapi/message/visitor.cpp b/storageapi/src/vespa/storageapi/message/visitor.cpp
index d87f65a72cf..ec7fb1dc2d4 100644
--- a/storageapi/src/vespa/storageapi/message/visitor.cpp
+++ b/storageapi/src/vespa/storageapi/message/visitor.cpp
@@ -74,6 +74,16 @@ CreateVisitorCommand::getBucket() const
return document::Bucket(_bucketSpace, document::BucketId());
}
+document::BucketId
+CreateVisitorCommand::super_bucket_id() const
+{
+ if (_buckets.empty()) {
+ // TODO STRIPE: Is this actually an error situation? Should be fixed elsewhere.
+ return document::BucketId();
+ }
+ return _buckets[0];
+}
+
void
CreateVisitorCommand::print(std::ostream& out, bool verbose,
const std::string& indent) const
@@ -120,6 +130,7 @@ CreateVisitorCommand::print(std::ostream& out, bool verbose,
CreateVisitorReply::CreateVisitorReply(const CreateVisitorCommand& cmd)
: StorageReply(cmd),
+ _super_bucket_id(cmd.super_bucket_id()),
_lastBucket(document::BucketId(INT_MAX))
{
}
diff --git a/storageapi/src/vespa/storageapi/message/visitor.h b/storageapi/src/vespa/storageapi/message/visitor.h
index 8440591ecde..1313b275e95 100644
--- a/storageapi/src/vespa/storageapi/message/visitor.h
+++ b/storageapi/src/vespa/storageapi/message/visitor.h
@@ -79,6 +79,7 @@ public:
uint32_t getVisitorCmdId() const { return _visitorCmdId; }
document::BucketSpace getBucketSpace() const { return _bucketSpace; }
document::Bucket getBucket() const override;
+ document::BucketId super_bucket_id() const;
const vespalib::string & getLibraryName() const { return _libName; }
const vespalib::string & getInstanceId() const { return _instanceId; }
const vespalib::string & getControlDestination() const { return _controlDestination; }
@@ -114,6 +115,7 @@ public:
*/
class CreateVisitorReply : public StorageReply {
private:
+ document::BucketId _super_bucket_id;
document::BucketId _lastBucket;
vdslib::VisitorStatistics _visitorStatistics;
@@ -124,6 +126,7 @@ public:
void setLastBucket(const document::BucketId& lastBucket) { _lastBucket = lastBucket; }
+ const document::BucketId& super_bucket_id() const { return _super_bucket_id; }
const document::BucketId& getLastBucket() const { return _lastBucket; }
void setVisitorStatistics(const vdslib::VisitorStatistics& stats) { _visitorStatistics = stats; }