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