// Copyright Vespa.ai. 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; } message PutRequest { Bucket bucket = 1; Document document = 2; uint64 new_timestamp = 3; uint64 expected_old_timestamp = 4; // If zero; no expectation. TestAndSetCondition condition = 5; bool create_if_non_existent = 6; } message PutResponse { BucketInfo bucket_info = 1; BucketId remapped_bucket_id = 2; bool was_found = 3; } message Update { bytes payload = 1; } message UpdateRequest { Bucket bucket = 1; Update update = 2; uint64 new_timestamp = 3; uint64 expected_old_timestamp = 4; // If zero; no expectation. TestAndSetCondition condition = 5; } message UpdateResponse { BucketInfo bucket_info = 1; BucketId remapped_bucket_id = 2; uint64 updated_timestamp = 3; } message RemoveRequest { Bucket bucket = 1; bytes document_id = 2; uint64 new_timestamp = 3; TestAndSetCondition condition = 4; } message RemoveResponse { BucketInfo bucket_info = 1; BucketId remapped_bucket_id = 2; uint64 removed_timestamp = 3; } message GetRequest { Bucket bucket = 1; bytes document_id = 2; bytes field_set = 3; uint64 before_timestamp = 4; enum InternalReadConsistency { Strong = 0; // Default for a good reason. Weak = 1; } InternalReadConsistency internal_read_consistency = 5; TestAndSetCondition condition = 6; } message GetResponse { Document document = 1; uint64 last_modified_timestamp = 2; BucketInfo bucket_info = 3; BucketId remapped_bucket_id = 4; // Note: last_modified_timestamp and tombstone_timestamp are mutually exclusive. // Tracked separately (rather than being a flag bool) to avoid issues during rolling upgrades. uint64 tombstone_timestamp = 5; bool condition_matched = 6; } message RevertRequest { Bucket bucket = 1; repeated uint64 revert_tokens = 2; } message RevertResponse { BucketInfo bucket_info = 1; BucketId remapped_bucket_id = 2; } message IdAndTimestamp { DocumentId id = 1; uint64 timestamp = 2; } message PhaseOneRemove { // Currently empty; its presence is enough } message PhaseTwoRemove { repeated IdAndTimestamp explicit_remove_set = 1; } message RemoveLocationRequest { Bucket bucket = 1; bytes document_selection = 2; oneof phased_remove { PhaseOneRemove phase_one = 3; PhaseTwoRemove phase_two = 4; } } message RemoveLocationStats { uint32 documents_removed = 1; } message RemoveLocationResponse { BucketInfo bucket_info = 1; BucketId remapped_bucket_id = 2; RemoveLocationStats stats = 3; repeated IdAndTimestamp selection_matches = 4; // Iff reply to phase 1 remove }