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