-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
datapath.proto
96 lines (80 loc) · 1.73 KB
/
datapath.proto
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
syntax = "proto3";
package datapath;
message SnapshotRead {
repeated ReadRange ranges = 1;
}
message SnapshotReadOutput {
repeated ReadRangeOutput ranges = 1;
bool read_disabled = 2;
repeated string regions_if_read_disabled = 3;
bool read_is_strongly_consistent = 4;
string primary_if_not_strongly_consistent = 5;
}
message ReadRange {
bytes start = 1;
bytes end = 2;
int32 limit = 3;
bool reverse = 4;
}
message ReadRangeOutput {
repeated KvEntry values = 1;
}
message AtomicWrite {
repeated KvCheck kv_checks = 1;
repeated KvMutation kv_mutations = 2;
repeated Enqueue enqueues = 3;
}
message AtomicWriteOutput {
AtomicWriteStatus status = 1;
bytes versionstamp = 2;
string primary_if_write_disabled = 3;
}
message KvCheck {
bytes key = 1;
bytes versionstamp = 2; // 10-byte raw versionstamp
}
message KvMutation {
bytes key = 1;
KvValue value = 2;
KvMutationType mutation_type = 3;
}
message KvValue {
bytes data = 1;
KvValueEncoding encoding = 2;
}
message KvEntry {
bytes key = 1;
bytes value = 2;
KvValueEncoding encoding = 3;
bytes versionstamp = 4;
}
enum KvMutationType {
M_UNSPECIFIED = 0;
M_SET = 1;
M_CLEAR = 2;
M_SUM = 3;
M_MAX = 4;
M_MIN = 5;
}
enum KvValueEncoding {
VE_UNSPECIFIED = 0;
VE_V8 = 1;
VE_LE64 = 2;
VE_BYTES = 3;
}
enum AtomicWriteStatus {
AW_UNSPECIFIED = 0;
AW_SUCCESS = 1;
AW_CHECK_FAILURE = 2;
AW_UNSUPPORTED_WRITE = 3;
AW_USAGE_LIMIT_EXCEEDED = 4;
AW_WRITE_DISABLED = 5;
AW_QUEUE_BACKLOG_LIMIT_EXCEEDED = 6;
}
message Enqueue {
bytes payload = 1;
int64 deadline_ms = 2;
repeated bytes kv_keys_if_undelivered = 3;
repeated uint32 backoff_schedule = 4;
}