aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-04-05 08:57:37 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-04-05 11:27:33 +0000
commitb2eb61ee0eec53d41a112c3679478c725bfc67aa (patch)
treeff199c3d7dcea7dd490370c76233be68583bbf21 /storageapi
parent83fce32dd607eeb3821cc58a1d01cb8878a46c46 (diff)
Break up protobufs into multiple files to avoid single, massive generated .h/.cc
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/tests/mbusprot/storageprotocoltest.cpp30
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt6
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protobuf/common.proto91
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protobuf/feed.proto104
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto168
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protobuf/storageapi.proto403
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protobuf/visiting.proto67
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp6
8 files changed, 467 insertions, 408 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
index 0851d3baa43..5a5d53ce950 100644
--- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
+++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
@@ -608,6 +608,33 @@ TEST_P(StorageProtocolTest, testGetBucketDiff) {
recordSerialization50();
}
+namespace {
+
+ApplyBucketDiffCommand::Entry dummy_apply_entry() {
+ ApplyBucketDiffCommand::Entry e;
+ e._docName = "my cool id";
+ vespalib::string header_data = "fancy header";
+ e._headerBlob.resize(header_data.size());
+ memcpy(&e._headerBlob[0], header_data.data(), header_data.size());
+
+ vespalib::string body_data = "fancier body!";
+ e._bodyBlob.resize(body_data.size());
+ memcpy(&e._bodyBlob[0], body_data.data(), body_data.size());
+
+ GetBucketDiffCommand::Entry meta;
+ meta._timestamp = 567890;
+ meta._hasMask = 0x3;
+ meta._flags = 0x1;
+ meta._headerSize = 12345;
+ meta._headerSize = header_data.size();
+ meta._bodySize = body_data.size();
+
+ e._entry = meta;
+ return e;
+}
+
+}
+
TEST_P(StorageProtocolTest, testApplyBucketDiff) {
document::BucketId bucketId(16, 623);
document::Bucket bucket(makeDocumentBucket(bucketId));
@@ -615,8 +642,7 @@ TEST_P(StorageProtocolTest, testApplyBucketDiff) {
std::vector<api::MergeBucketCommand::Node> nodes;
nodes.push_back(4);
nodes.push_back(13);
- std::vector<ApplyBucketDiffCommand::Entry> entries;
- entries.push_back(ApplyBucketDiffCommand::Entry());
+ std::vector<ApplyBucketDiffCommand::Entry> entries = {dummy_apply_entry()};
auto cmd = std::make_shared<ApplyBucketDiffCommand>(bucket, nodes, 1234);
cmd->getDiff() = entries;
diff --git a/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt b/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt
index 36fb168d5f1..dc4e3897e49 100644
--- a/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt
+++ b/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt
@@ -1,7 +1,11 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
find_package(Protobuf REQUIRED)
-PROTOBUF_GENERATE_CPP(storageapi_PROTOBUF_SRCS storageapi_PROTOBUF_HDRS protobuf/storageapi.proto)
+PROTOBUF_GENERATE_CPP(storageapi_PROTOBUF_SRCS storageapi_PROTOBUF_HDRS
+ protobuf/common.proto
+ protobuf/feed.proto
+ protobuf/visiting.proto
+ protobuf/maintenance.proto)
# protoc-generated files emit compiler warnings that we normally treat as errors.
# Instead of rolling our own compiler plugin we'll pragmatically disable the noise.
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protobuf/common.proto b/storageapi/src/vespa/storageapi/mbusprot/protobuf/common.proto
new file mode 100644
index 00000000000..e7c0a641407
--- /dev/null
+++ b/storageapi/src/vespa/storageapi/mbusprot/protobuf/common.proto
@@ -0,0 +1,91 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+syntax = "proto3";
+
+option cc_enable_arenas = true;
+
+package storage.mbusprot.protobuf;
+
+// Note: we use a *Request/*Response naming convention rather than *Command/*Reply,
+// as the former is the gRPC convention and that's where we intend to move.
+
+// Next tag to use: 2
+message BucketSpace {
+ uint64 space_id = 1;
+}
+
+// Next tag to use: 2
+message BucketId {
+ fixed64 raw_id = 1;
+}
+
+// Next tag to use: 3
+message Bucket {
+ uint64 space_id = 1;
+ fixed64 raw_bucket_id = 2;
+}
+
+// Next tag to use: 9
+message BucketInfoV1 {
+ uint64 last_modified_timestamp = 1;
+ // TODO version the checksum instead?
+ fixed32 checksum = 2;
+ uint32 doc_count = 3;
+ uint32 total_doc_size = 4;
+ uint32 meta_count = 5;
+ uint32 used_file_size = 6;
+ bool ready = 7;
+ bool active = 8;
+}
+
+// Next tag to use: 10
+message BucketInfoV2 {
+ uint64 last_modified_timestamp = 1;
+ // TODO version the checksum instead?
+ fixed64 checksum_lo = 2;
+ fixed64 checksum_hi = 3;
+ uint32 doc_count = 4;
+ uint32 total_doc_size = 5;
+ uint32 meta_count = 6;
+ uint32 used_file_size = 7;
+ bool ready = 8;
+ bool active = 9;
+}
+
+// Next tag to use: 3
+message BucketInfo {
+ BucketInfoV1 info_v1 = 1;
+ BucketInfoV2 info_v2 = 2;
+}
+
+message GlobalId {
+ // 96 bits of GID data in _little_ endian.
+ fixed64 lo_64 = 1;
+ fixed32 hi_32 = 2;
+}
+
+// TODO these should ideally be gRPC headers..
+message RequestHeader {
+ uint64 message_id = 1;
+ uint32 priority = 2; // Always in range [0, 255]
+ uint32 source_index = 3; // Always in range [0, 65535]
+ fixed32 loadtype_id = 4;
+}
+
+// TODO these should ideally be gRPC headers..
+message ResponseHeader {
+ // TODO this should ideally be gRPC Status...
+ uint32 return_code_id = 1;
+ bytes return_code_message = 2; // FIXME it's `bytes` since `string` will check for UTF-8... might not hold...
+ uint64 message_id = 3;
+ uint32 priority = 4; // Always in range [0, 255]
+}
+
+// TODO extract bucket info response fields to own message!
+
+message Document {
+ bytes payload = 1;
+}
+
+message DocumentId {
+ bytes id = 1;
+}
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protobuf/feed.proto b/storageapi/src/vespa/storageapi/mbusprot/protobuf/feed.proto
new file mode 100644
index 00000000000..48d482adc0c
--- /dev/null
+++ b/storageapi/src/vespa/storageapi/mbusprot/protobuf/feed.proto
@@ -0,0 +1,104 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+syntax = "proto3";
+
+option cc_enable_arenas = true;
+
+package storage.mbusprot.protobuf;
+
+import "common.proto";
+
+message TestAndSetCondition {
+ bytes selection = 1;
+}
+
+// Next tag to use: 6
+message PutRequest {
+ Bucket bucket = 1;
+ Document document = 2;
+ uint64 new_timestamp = 3;
+ uint64 expected_old_timestamp = 4; // If zero; no expectation.
+ TestAndSetCondition condition = 5;
+}
+
+// Next tag to use: 4
+message PutResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+ bool was_found = 3;
+}
+
+// Next tag to use: 2
+message Update {
+ bytes payload = 1;
+}
+
+// Next tag to use: 6
+message UpdateRequest {
+ Bucket bucket = 1;
+ Update update = 2;
+ uint64 new_timestamp = 3;
+ uint64 expected_old_timestamp = 4; // If zero; no expectation.
+ TestAndSetCondition condition = 5;
+}
+
+// Next tag to use: 4
+message UpdateResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+ uint64 updated_timestamp = 3;
+}
+
+// Next tag to use: 5
+message RemoveRequest {
+ Bucket bucket = 1;
+ bytes document_id = 2;
+ uint64 new_timestamp = 3;
+ TestAndSetCondition condition = 4;
+}
+
+// Next tag to use: 4
+message RemoveResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+ uint64 removed_timestamp = 3;
+}
+
+// Next tag to use: 5
+message GetRequest {
+ Bucket bucket = 1;
+ bytes document_id = 2;
+ bytes field_set = 3;
+ uint64 before_timestamp = 4;
+}
+
+// Next tag to use: 5
+message GetResponse {
+ Document document = 1;
+ uint64 last_modified_timestamp = 2;
+ BucketInfo bucket_info = 3;
+ BucketId remapped_bucket_id = 4;
+}
+
+// TODO consider deprecation/removal if this is not used in practice.
+message RevertRequest {
+ Bucket bucket = 1;
+ repeated uint64 revert_tokens = 2;
+}
+
+// Next tag to use: 3
+message RevertResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+}
+
+// Next tag to use: 3
+message RemoveLocationRequest {
+ Bucket bucket = 1;
+ bytes document_selection = 2;
+}
+
+// Next tag to use: 3
+message RemoveLocationResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+}
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto b/storageapi/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto
new file mode 100644
index 00000000000..847586a0248
--- /dev/null
+++ b/storageapi/src/vespa/storageapi/mbusprot/protobuf/maintenance.proto
@@ -0,0 +1,168 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+syntax = "proto3";
+
+option cc_enable_arenas = true;
+
+package storage.mbusprot.protobuf;
+
+import "common.proto";
+
+// Next tag to use: 3
+message DeleteBucketRequest {
+ Bucket bucket = 1;
+ BucketInfo expected_bucket_info = 2;
+}
+
+// Next tag to use: 3
+message DeleteBucketResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+}
+
+// Next tag to use: 3
+message CreateBucketRequest {
+ Bucket bucket = 1;
+ bool create_as_active = 2;
+}
+
+// Next tag to use: 3
+message CreateBucketResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+}
+
+// Next tag to use: 3
+message MergeNode {
+ uint32 index = 1;
+ bool source_only = 2;
+}
+
+// Next tag to use: 6
+message MergeBucketRequest {
+ Bucket bucket = 1;
+ uint32 cluster_state_version = 2;
+ uint64 max_timestamp = 3;
+ repeated MergeNode nodes = 4;
+ repeated uint32 node_chain = 5;
+}
+
+// Next tag to use: 2
+message MergeBucketResponse {
+ BucketId remapped_bucket_id = 1;
+}
+
+message MetaDiffEntry {
+ uint64 timestamp = 1;
+ GlobalId gid = 2;
+ uint32 header_size = 3; // TODO one of these can be removed...!
+ uint32 body_size = 4;
+ uint32 flags = 5;
+ uint32 has_mask = 6;
+}
+
+message GetBucketDiffRequest {
+ Bucket bucket = 1;
+ uint64 max_timestamp = 2;
+ repeated MergeNode nodes = 3;
+ repeated MetaDiffEntry diff = 4;
+}
+
+message GetBucketDiffResponse {
+ BucketId remapped_bucket_id = 1;
+ repeated MetaDiffEntry diff = 2;
+}
+
+message ApplyDiffEntry {
+ MetaDiffEntry entry_meta = 1;
+ bytes document_id = 2;
+ bytes header_blob = 3; // TODO use singular blob
+ bytes body_blob = 4;
+}
+
+message ApplyBucketDiffRequest {
+ Bucket bucket = 1;
+ repeated MergeNode nodes = 2;
+ uint32 max_buffer_size = 3;
+ repeated ApplyDiffEntry entries = 4;
+}
+
+message ApplyBucketDiffResponse {
+ BucketId remapped_bucket_id = 1;
+ repeated ApplyDiffEntry entries = 4;
+}
+
+message ExplicitBucketSet {
+ // `Bucket` is not needed, as the space is inferred from the owning message.
+ repeated BucketId bucket_ids = 2;
+}
+
+message AllBuckets {
+ uint32 distributor_index = 1;
+ bytes cluster_state = 2;
+ bytes distribution_hash = 3;
+}
+
+message RequestBucketInfoRequest {
+ BucketSpace bucket_space = 1;
+ oneof request_for {
+ ExplicitBucketSet explicit_bucket_set = 2;
+ AllBuckets all_buckets = 3;
+ }
+ // TODO bucket info version requested
+}
+
+message BucketAndBucketInfo {
+ fixed64 raw_bucket_id = 1;
+ BucketInfo bucket_info = 2;
+}
+
+message RequestBucketInfoResponse {
+ repeated BucketAndBucketInfo bucket_infos = 1;
+}
+
+message NotifyBucketChangeRequest {
+ Bucket bucket = 1;
+ BucketInfo bucket_info = 2;
+}
+
+message NotifyBucketChangeResponse {
+ // Currently empty
+}
+
+message SplitBucketRequest {
+ Bucket bucket = 1;
+ uint32 min_split_bits = 2;
+ uint32 max_split_bits = 3;
+ uint32 min_byte_size = 4;
+ uint32 min_doc_count = 5;
+}
+
+message SplitBucketResponse {
+ BucketId remapped_bucket_id = 1;
+ repeated BucketAndBucketInfo split_info = 2;
+}
+
+message JoinBucketsRequest {
+ Bucket bucket = 1;
+ repeated BucketId source_buckets = 2;
+ uint32 min_join_bits = 3;
+}
+
+message JoinBucketsResponse {
+ BucketInfo bucket_info = 1;
+ BucketId remapped_bucket_id = 2;
+}
+
+message SetBucketStateRequest {
+ enum BucketState {
+ Inactive = 0;
+ Active = 1;
+ }
+
+ Bucket bucket = 1;
+ BucketState state = 2;
+}
+
+message SetBucketStateResponse {
+ BucketId remapped_bucket_id = 1;
+}
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protobuf/storageapi.proto b/storageapi/src/vespa/storageapi/mbusprot/protobuf/storageapi.proto
deleted file mode 100644
index 26cbd7ef303..00000000000
--- a/storageapi/src/vespa/storageapi/mbusprot/protobuf/storageapi.proto
+++ /dev/null
@@ -1,403 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-syntax = "proto3";
-
-option cc_enable_arenas = true;
-
-package storage.mbusprot.protobuf;
-
-// Note: we use a *Request/*Response naming convention rather than *Command/*Reply,
-// as the former is the gRPC convention and that's where we intend to move.
-
-// Next tag to use: 2
-message BucketSpace {
- uint64 space_id = 1;
-}
-
-// Next tag to use: 2
-message BucketId {
- fixed64 raw_id = 1;
-}
-
-// Next tag to use: 3
-message Bucket {
- uint64 space_id = 1;
- fixed64 raw_bucket_id = 2;
-}
-
-// Next tag to use: 9
-message BucketInfoV1 {
- uint64 last_modified_timestamp = 1;
- // TODO version the checksum instead?
- fixed32 checksum = 2;
- uint32 doc_count = 3;
- uint32 total_doc_size = 4;
- uint32 meta_count = 5;
- uint32 used_file_size = 6;
- bool ready = 7;
- bool active = 8;
-}
-
-// Next tag to use: 10
-message BucketInfoV2 {
- uint64 last_modified_timestamp = 1;
- // TODO version the checksum instead?
- fixed64 checksum_lo = 2;
- fixed64 checksum_hi = 3;
- uint32 doc_count = 4;
- uint32 total_doc_size = 5;
- uint32 meta_count = 6;
- uint32 used_file_size = 7;
- bool ready = 8;
- bool active = 9;
-}
-
-// Next tag to use: 3
-message BucketInfo {
- BucketInfoV1 info_v1 = 1;
- BucketInfoV2 info_v2 = 2;
-}
-
-message GlobalId {
- // 96 bits of GID data in _little_ endian.
- fixed64 lo_64 = 1;
- fixed32 hi_32 = 2;
-}
-
-// TODO these should ideally be gRPC headers..
-message RequestHeader {
- uint64 message_id = 1;
- uint32 priority = 2; // Always in range [0, 255]
- uint32 source_index = 3; // Always in range [0, 65535]
- fixed32 loadtype_id = 4;
-}
-
-// TODO these should ideally be gRPC headers..
-message ResponseHeader {
- // TODO this should ideally be gRPC Status...
- uint32 return_code_id = 1;
- bytes return_code_message = 2; // FIXME it's `bytes` since `string` will check for UTF-8... might not hold...
- uint64 message_id = 3;
- uint32 priority = 4; // Always in range [0, 255]
-}
-
-// TODO extract bucket info response fields to own message!
-
-message Document {
- bytes payload = 1;
-}
-
-message DocumentId {
- bytes id = 1;
-}
-
-message TestAndSetCondition {
- bytes selection = 1;
-}
-
-// Next tag to use: 6
-message PutRequest {
- Bucket bucket = 1;
- Document document = 2;
- uint64 new_timestamp = 3;
- uint64 expected_old_timestamp = 4; // If zero; no expectation.
- TestAndSetCondition condition = 5;
-}
-
-// Next tag to use: 4
-message PutResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
- bool was_found = 3;
-}
-
-// Next tag to use: 2
-message Update {
- bytes payload = 1;
-}
-
-// Next tag to use: 6
-message UpdateRequest {
- Bucket bucket = 1;
- Update update = 2;
- uint64 new_timestamp = 3;
- uint64 expected_old_timestamp = 4; // If zero; no expectation.
- TestAndSetCondition condition = 5;
-}
-
-// Next tag to use: 4
-message UpdateResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
- uint64 updated_timestamp = 3;
-}
-
-// Next tag to use: 5
-message RemoveRequest {
- Bucket bucket = 1;
- bytes document_id = 2;
- uint64 new_timestamp = 3;
- TestAndSetCondition condition = 4;
-}
-
-// Next tag to use: 4
-message RemoveResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
- uint64 removed_timestamp = 3;
-}
-
-// Next tag to use: 5
-message GetRequest {
- Bucket bucket = 1;
- bytes document_id = 2;
- bytes field_set = 3;
- uint64 before_timestamp = 4;
-}
-
-// Next tag to use: 5
-message GetResponse {
- Document document = 1;
- uint64 last_modified_timestamp = 2;
- BucketInfo bucket_info = 3;
- BucketId remapped_bucket_id = 4;
-}
-
-// TODO consider deprecation/removal if this is not used in practice.
-message RevertRequest {
- Bucket bucket = 1;
- repeated uint64 revert_tokens = 2;
-}
-
-// Next tag to use: 3
-message RevertResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
-}
-
-// Next tag to use: 3
-message DeleteBucketRequest {
- Bucket bucket = 1;
- BucketInfo expected_bucket_info = 2;
-}
-
-// Next tag to use: 3
-message DeleteBucketResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
-}
-
-// Next tag to use: 3
-message CreateBucketRequest {
- Bucket bucket = 1;
- bool create_as_active = 2;
-}
-
-// Next tag to use: 3
-message CreateBucketResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
-}
-
-// Next tag to use: 3
-message MergeNode {
- uint32 index = 1;
- bool source_only = 2;
-}
-
-// Next tag to use: 6
-message MergeBucketRequest {
- Bucket bucket = 1;
- uint32 cluster_state_version = 2;
- uint64 max_timestamp = 3;
- repeated MergeNode nodes = 4;
- repeated uint32 node_chain = 5;
-}
-
-// Next tag to use: 2
-message MergeBucketResponse {
- BucketId remapped_bucket_id = 1;
-}
-
-message MetaDiffEntry {
- uint64 timestamp = 1;
- GlobalId gid = 2;
- uint32 header_size = 3; // TODO one of these can be removed...!
- uint32 body_size = 4;
- uint32 flags = 5;
- uint32 has_mask = 6;
-}
-
-message GetBucketDiffRequest {
- Bucket bucket = 1;
- uint64 max_timestamp = 2;
- repeated MergeNode nodes = 3;
- repeated MetaDiffEntry diff = 4;
-}
-
-message GetBucketDiffResponse {
- BucketId remapped_bucket_id = 1;
- repeated MetaDiffEntry diff = 2;
-}
-
-message ApplyDiffEntry {
- MetaDiffEntry entry_meta = 1;
- bytes document_id = 2;
- bytes header_blob = 3; // TODO use singular blob
- bytes body_blob = 4;
-}
-
-message ApplyBucketDiffRequest {
- Bucket bucket = 1;
- repeated MergeNode nodes = 2;
- uint32 max_buffer_size = 3;
- repeated ApplyDiffEntry entries = 4;
-}
-
-message ApplyBucketDiffResponse {
- BucketId remapped_bucket_id = 1;
- repeated ApplyDiffEntry entries = 4;
-}
-
-message ExplicitBucketSet {
- // `Bucket` is not needed, as the space is inferred from the owning message.
- repeated BucketId bucket_ids = 2;
-}
-
-message AllBuckets {
- uint32 distributor_index = 1;
- bytes cluster_state = 2;
- bytes distribution_hash = 3;
-}
-
-message RequestBucketInfoRequest {
- BucketSpace bucket_space = 1;
- oneof request_for {
- ExplicitBucketSet explicit_bucket_set = 2;
- AllBuckets all_buckets = 3;
- }
- // TODO bucket info version requested
-}
-
-message BucketAndBucketInfo {
- fixed64 raw_bucket_id = 1;
- BucketInfo bucket_info = 2;
-}
-
-message RequestBucketInfoResponse {
- repeated BucketAndBucketInfo bucket_infos = 1;
-}
-
-message NotifyBucketChangeRequest {
- Bucket bucket = 1;
- BucketInfo bucket_info = 2;
-}
-
-message NotifyBucketChangeResponse {
- // Currently empty
-}
-
-message SplitBucketRequest {
- Bucket bucket = 1;
- uint32 min_split_bits = 2;
- uint32 max_split_bits = 3;
- uint32 min_byte_size = 4;
- uint32 min_doc_count = 5;
-}
-
-message SplitBucketResponse {
- BucketId remapped_bucket_id = 1;
- repeated BucketAndBucketInfo split_info = 2;
-}
-
-message JoinBucketsRequest {
- Bucket bucket = 1;
- repeated BucketId source_buckets = 2;
- uint32 min_join_bits = 3;
-}
-
-message JoinBucketsResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
-}
-
-message SetBucketStateRequest {
- enum BucketState {
- Inactive = 0;
- Active = 1;
- }
-
- Bucket bucket = 1;
- BucketState state = 2;
-}
-
-message SetBucketStateResponse {
- BucketId remapped_bucket_id = 1;
-}
-
-message ClientVisitorParameter {
- bytes key = 1;
- bytes value = 2;
-}
-
-message VisitorConstraints {
- bytes document_selection = 1;
- uint64 from_time_usec = 2;
- uint64 to_time_usec = 3;
- bool visit_removes = 5;
- bytes field_set = 6;
- bool visit_inconsistent_buckets = 7;
-}
-
-message VisitorControlMeta {
- bytes instance_id = 1;
- bytes library_name = 2;
- uint32 visitor_command_id = 3;
- bytes control_destination = 4;
- bytes data_destination = 5;
-
- // TODO move?
- uint32 max_pending_reply_count = 6;
- uint32 queue_timeout = 7;
- uint32 max_buckets_per_visitor = 8;
-}
-
-message CreateVisitorRequest {
- BucketSpace bucket_space = 1;
- repeated BucketId buckets = 2;
-
- VisitorConstraints constraints = 3;
- VisitorControlMeta control_meta = 4;
- repeated ClientVisitorParameter client_parameters = 5;
-}
-
-message VisitorStatistics {
- uint32 buckets_visited = 1;
- uint64 documents_visited = 2;
- uint64 bytes_visited = 3;
- uint64 documents_returned = 4;
- uint64 bytes_returned = 5;
- uint64 second_pass_documents_returned = 6; // TODO don't include? orderdoc only
- uint64 second_pass_bytes_returned = 7; // TODO don't include? orderdoc only
-}
-
-message CreateVisitorResponse {
- VisitorStatistics visitor_statistics = 1;
-}
-
-message DestroyVisitorRequest {
- bytes instance_id = 1;
-}
-
-message DestroyVisitorResponse {
- // Currently empty
-}
-
-message RemoveLocationRequest {
- Bucket bucket = 1;
- bytes document_selection = 2;
-}
-
-message RemoveLocationResponse {
- BucketInfo bucket_info = 1;
- BucketId remapped_bucket_id = 2;
-}
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protobuf/visiting.proto b/storageapi/src/vespa/storageapi/mbusprot/protobuf/visiting.proto
new file mode 100644
index 00000000000..2c744f9dd70
--- /dev/null
+++ b/storageapi/src/vespa/storageapi/mbusprot/protobuf/visiting.proto
@@ -0,0 +1,67 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+syntax = "proto3";
+
+option cc_enable_arenas = true;
+
+package storage.mbusprot.protobuf;
+
+import "common.proto";
+
+
+message ClientVisitorParameter {
+ bytes key = 1;
+ bytes value = 2;
+}
+
+message VisitorConstraints {
+ bytes document_selection = 1;
+ uint64 from_time_usec = 2;
+ uint64 to_time_usec = 3;
+ bool visit_removes = 5;
+ bytes field_set = 6;
+ bool visit_inconsistent_buckets = 7;
+}
+
+message VisitorControlMeta {
+ bytes instance_id = 1;
+ bytes library_name = 2;
+ uint32 visitor_command_id = 3;
+ bytes control_destination = 4;
+ bytes data_destination = 5;
+
+ // TODO move?
+ uint32 max_pending_reply_count = 6;
+ uint32 queue_timeout = 7;
+ uint32 max_buckets_per_visitor = 8;
+}
+
+message CreateVisitorRequest {
+ BucketSpace bucket_space = 1;
+ repeated BucketId buckets = 2;
+
+ VisitorConstraints constraints = 3;
+ VisitorControlMeta control_meta = 4;
+ repeated ClientVisitorParameter client_parameters = 5;
+}
+
+message VisitorStatistics {
+ uint32 buckets_visited = 1;
+ uint64 documents_visited = 2;
+ uint64 bytes_visited = 3;
+ uint64 documents_returned = 4;
+ uint64 bytes_returned = 5;
+ uint64 second_pass_documents_returned = 6; // TODO don't include? orderdoc only
+ uint64 second_pass_bytes_returned = 7; // TODO don't include? orderdoc only
+}
+
+message CreateVisitorResponse {
+ VisitorStatistics visitor_statistics = 1;
+}
+
+message DestroyVisitorRequest {
+ bytes instance_id = 1;
+}
+
+message DestroyVisitorResponse {
+ // Currently empty
+} \ No newline at end of file
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp
index b5b560a3df0..979e4162a7a 100644
--- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp
+++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp
@@ -7,7 +7,9 @@
#include "protocolserialization7.h"
#include "serializationhelper.h"
-#include "storageapi.pb.h"
+#include "feed.pb.h"
+#include "visiting.pb.h"
+#include "maintenance.pb.h"
#pragma GCC diagnostic pop
@@ -722,7 +724,7 @@ void set_diff_entry(protobuf::MetaDiffEntry& dest, const api::GetBucketDiffComma
dest.set_header_size(src._headerSize);
dest.set_body_size(src._bodySize);
dest.set_flags(src._flags);
- dest.set_has_mask(src._flags);
+ dest.set_has_mask(src._hasMask);
}
api::GetBucketDiffCommand::Entry get_diff_entry(const protobuf::MetaDiffEntry& src) {