1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct Hello {
5 #[prost(string, tag = "1")]
6 pub identity: ::prost::alloc::string::String,
7 #[prost(bytes = "vec", tag = "2")]
8 pub challenge: ::prost::alloc::vec::Vec<u8>,
9 #[prost(uint32, tag = "3")]
10 pub min_version: u32,
11 #[prost(uint32, tag = "4")]
12 pub max_version: u32,
13 #[prost(uint64, tag = "5")]
14 pub capabilities: u64,
15}
16#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
17pub struct Auth {
18 #[prost(bytes = "vec", tag = "1")]
19 pub proof: ::prost::alloc::vec::Vec<u8>,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct Frame {
23 #[prost(oneof = "frame::Message", tags = "1, 2, 3, 4")]
24 pub message: ::core::option::Option<frame::Message>,
25}
26pub mod frame {
28 #[derive(Clone, PartialEq, ::prost::Oneof)]
29 pub enum Message {
30 #[prost(message, tag = "1")]
31 Hello(super::Hello),
32 #[prost(message, tag = "2")]
33 Auth(super::Auth),
34 #[prost(message, tag = "3")]
35 Request(super::Request),
36 #[prost(message, tag = "4")]
37 Response(super::Response),
38 }
39}
40#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
41pub struct Get {
42 #[prost(string, tag = "1")]
43 pub key: ::prost::alloc::string::String,
44 #[prost(enumeration = "super::meta::Priority", tag = "2")]
45 pub priority: i32,
46}
47#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
48pub struct Put {
49 #[prost(string, tag = "1")]
50 pub key: ::prost::alloc::string::String,
51 #[prost(bytes = "vec", tag = "2")]
52 pub value: ::prost::alloc::vec::Vec<u8>,
53 #[prost(uint64, optional, tag = "3")]
54 pub ttl_ms: ::core::option::Option<u64>,
55 #[prost(enumeration = "super::meta::Priority", tag = "4")]
56 pub priority: i32,
57}
58#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
59pub struct Delete {
60 #[prost(string, tag = "1")]
61 pub key: ::prost::alloc::string::String,
62 #[prost(enumeration = "super::meta::Priority", tag = "2")]
63 pub priority: i32,
64}
65#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
66pub struct BatchGet {
67 #[prost(string, repeated, tag = "1")]
68 pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
69 #[prost(enumeration = "super::meta::Priority", tag = "2")]
70 pub priority: i32,
71}
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct BatchPut {
74 #[prost(message, repeated, tag = "1")]
75 pub puts: ::prost::alloc::vec::Vec<Put>,
76 #[prost(enumeration = "super::meta::Priority", tag = "2")]
77 pub priority: i32,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct Query {
81 #[prost(string, tag = "1")]
82 pub sql: ::prost::alloc::string::String,
83 #[prost(message, repeated, tag = "2")]
84 pub params: ::prost::alloc::vec::Vec<super::meta::QueryCell>,
85}
86#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Inspect {}
88#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
89pub struct Scan {
90 #[prost(uint32, tag = "1")]
91 pub matcher_kind: u32,
92 #[prost(bytes = "vec", tag = "2")]
93 pub prefix: ::prost::alloc::vec::Vec<u8>,
94 #[prost(uint32, tag = "3")]
95 pub transform_kind: u32,
96 #[prost(uint32, tag = "4")]
97 pub prefix_bytes: u32,
98 #[prost(uint32, tag = "5")]
99 pub limit: u32,
100 #[prost(uint64, tag = "6")]
101 pub offset: u64,
102}
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct Request {
105 #[prost(uint64, tag = "1")]
106 pub id: u64,
107 #[prost(oneof = "request::Operation", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
108 pub operation: ::core::option::Option<request::Operation>,
109}
110pub mod request {
112 #[derive(Clone, PartialEq, ::prost::Oneof)]
113 pub enum Operation {
114 #[prost(message, tag = "2")]
115 Get(super::Get),
116 #[prost(message, tag = "3")]
117 Put(super::Put),
118 #[prost(message, tag = "4")]
119 Delete(super::Delete),
120 #[prost(message, tag = "5")]
121 BatchGet(super::BatchGet),
122 #[prost(message, tag = "6")]
123 BatchPut(super::BatchPut),
124 #[prost(message, tag = "7")]
125 Query(super::Query),
126 #[prost(message, tag = "8")]
127 Inspect(super::Inspect),
128 #[prost(message, tag = "9")]
129 Scan(super::Scan),
130 }
131}
132#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
133pub struct Error {
134 #[prost(enumeration = "ErrorCode", tag = "1")]
135 pub code: i32,
136 #[prost(string, tag = "2")]
137 pub message: ::prost::alloc::string::String,
138 #[prost(uint64, tag = "3")]
139 pub winner_timestamp_ms: u64,
140 #[prost(string, tag = "4")]
141 pub winner_node_id: ::prost::alloc::string::String,
142 #[prost(bool, tag = "5")]
143 pub winner_is_tombstone: bool,
144}
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct Value {
147 #[prost(bytes = "vec", tag = "1")]
148 pub bytes: ::prost::alloc::vec::Vec<u8>,
149 #[prost(uint64, tag = "2")]
150 pub timestamp_ms: u64,
151 #[prost(string, tag = "3")]
152 pub node_id: ::prost::alloc::string::String,
153 #[prost(uint64, optional, tag = "4")]
154 pub expires_at_ms: ::core::option::Option<u64>,
155}
156#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
157pub struct ReadResult {
158 #[prost(string, tag = "1")]
159 pub key: ::prost::alloc::string::String,
160 #[prost(message, optional, tag = "2")]
161 pub value: ::core::option::Option<Value>,
162 #[prost(message, optional, tag = "3")]
163 pub error: ::core::option::Option<Error>,
164}
165#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct MutationResult {
167 #[prost(string, tag = "1")]
168 pub key: ::prost::alloc::string::String,
169 #[prost(message, optional, tag = "2")]
170 pub error: ::core::option::Option<Error>,
171}
172#[derive(Clone, PartialEq, ::prost::Message)]
173pub struct QueryResult {
174 #[prost(string, repeated, tag = "1")]
175 pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
176 #[prost(message, repeated, tag = "2")]
177 pub rows: ::prost::alloc::vec::Vec<super::meta::QueryPageRow>,
178}
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct FragmentHealth {
181 #[prost(uint32, tag = "1")]
182 pub fragment: u32,
183 #[prost(uint64, tag = "2")]
184 pub worker_count: u64,
185 #[prost(string, repeated, tag = "3")]
186 pub worker_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
187 #[prost(map = "string, uint64", tag = "4")]
188 pub restarts: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
189 #[prost(uint64, tag = "5")]
190 pub last_reaped: u64,
191 #[prost(uint64, tag = "6")]
192 pub shed_high: u64,
193 #[prost(uint64, tag = "7")]
194 pub shed_default: u64,
195 #[prost(uint64, tag = "8")]
196 pub shed_background: u64,
197}
198#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
199pub struct Placement {
200 #[prost(uint32, tag = "1")]
201 pub fragment: u32,
202 #[prost(string, repeated, tag = "2")]
203 pub replica_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
204 #[prost(string, tag = "3")]
205 pub state: ::prost::alloc::string::String,
206}
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct Inspection {
209 #[prost(string, tag = "1")]
210 pub node_id: ::prost::alloc::string::String,
211 #[prost(string, tag = "2")]
212 pub peer_addr: ::prost::alloc::string::String,
213 #[prost(uint64, tag = "3")]
214 pub peer_count: u64,
215 #[prost(message, repeated, tag = "4")]
216 pub health: ::prost::alloc::vec::Vec<FragmentHealth>,
217 #[prost(message, repeated, tag = "5")]
218 pub placement: ::prost::alloc::vec::Vec<Placement>,
219 #[prost(bool, tag = "6")]
220 pub dynamic: bool,
221}
222#[derive(Clone, PartialEq, ::prost::Message)]
223pub struct Response {
224 #[prost(uint64, tag = "1")]
225 pub id: u64,
226 #[prost(message, optional, tag = "2")]
227 pub error: ::core::option::Option<Error>,
228 #[prost(message, repeated, tag = "3")]
229 pub reads: ::prost::alloc::vec::Vec<ReadResult>,
230 #[prost(message, repeated, tag = "4")]
231 pub mutations: ::prost::alloc::vec::Vec<MutationResult>,
232 #[prost(message, optional, tag = "5")]
233 pub query: ::core::option::Option<QueryResult>,
234 #[prost(message, optional, tag = "6")]
235 pub inspection: ::core::option::Option<Inspection>,
236 #[prost(message, repeated, tag = "7")]
237 pub scans: ::prost::alloc::vec::Vec<super::meta::ScanMatch>,
238}
239#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
240#[repr(i32)]
241pub enum ErrorCode {
242 Unknown = 0,
243 Invalid = 1,
244 Backpressure = 2,
245 Storage = 3,
246 Unavailable = 4,
247 Superseded = 5,
248 Expired = 6,
249 ShuttingDown = 7,
250 Query = 8,
251 Unsupported = 9,
252 ResourceLimit = 10,
253 UnknownOutcome = 11,
254 QueryChanged = 12,
255}
256impl ErrorCode {
257 pub fn as_str_name(&self) -> &'static str {
262 match self {
263 Self::Unknown => "ERROR_CODE_UNKNOWN",
264 Self::Invalid => "ERROR_CODE_INVALID",
265 Self::Backpressure => "ERROR_CODE_BACKPRESSURE",
266 Self::Storage => "ERROR_CODE_STORAGE",
267 Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
268 Self::Superseded => "ERROR_CODE_SUPERSEDED",
269 Self::Expired => "ERROR_CODE_EXPIRED",
270 Self::ShuttingDown => "ERROR_CODE_SHUTTING_DOWN",
271 Self::Query => "ERROR_CODE_QUERY",
272 Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
273 Self::ResourceLimit => "ERROR_CODE_RESOURCE_LIMIT",
274 Self::UnknownOutcome => "ERROR_CODE_UNKNOWN_OUTCOME",
275 Self::QueryChanged => "ERROR_CODE_QUERY_CHANGED",
276 }
277 }
278 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
280 match value {
281 "ERROR_CODE_UNKNOWN" => Some(Self::Unknown),
282 "ERROR_CODE_INVALID" => Some(Self::Invalid),
283 "ERROR_CODE_BACKPRESSURE" => Some(Self::Backpressure),
284 "ERROR_CODE_STORAGE" => Some(Self::Storage),
285 "ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
286 "ERROR_CODE_SUPERSEDED" => Some(Self::Superseded),
287 "ERROR_CODE_EXPIRED" => Some(Self::Expired),
288 "ERROR_CODE_SHUTTING_DOWN" => Some(Self::ShuttingDown),
289 "ERROR_CODE_QUERY" => Some(Self::Query),
290 "ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
291 "ERROR_CODE_RESOURCE_LIMIT" => Some(Self::ResourceLimit),
292 "ERROR_CODE_UNKNOWN_OUTCOME" => Some(Self::UnknownOutcome),
293 "ERROR_CODE_QUERY_CHANGED" => Some(Self::QueryChanged),
294 _ => None,
295 }
296 }
297}