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