aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi/mbusprot/protobuf/common.proto
blob: 49e1a8f8aba8e03657d5261951242a189a2f3653 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright Yahoo. 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.

message BucketSpace {
   uint64 space_id = 1;
}

message BucketId {
   fixed64 raw_id = 1;
}

message Bucket {
    uint64  space_id      = 1;
    fixed64 raw_bucket_id = 2;
}

// Next tag to use: 3
message BucketInfo {
    uint64  last_modified_timestamp = 1;
    fixed32 legacy_checksum = 2;
    // TODO v2 checksum
    uint32  doc_count       = 3;
    uint32  total_doc_size  = 4;
    uint32  meta_count      = 5;
    uint32  used_file_size  = 6;
    bool    ready           = 7;
    bool    active          = 8;
}

message GlobalId {
    // 96 bits of GID data in _little_ endian. High entropy, so fixed encoding is better than varint.
    // Low 64 bits as if memcpy()ed from bytes [0, 8) of the GID buffer
    fixed64 lo_64 = 1;
    // High 32 bits as if memcpy()ed from bytes [8, 12) of the GID buffer
    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; // It's a hash with high entropy, so fixed encoding is better than varint
}

// 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]
}

message Document {
    bytes payload = 1;
}

message DocumentId {
    bytes id = 1;
}