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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataShape {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NumpyMultiDataset {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<NumpyDataset>,
#[prost(map = "string, int32", tag = "2")]
pub start_index: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
#[prost(map = "string, int32", tag = "3")]
pub lengths: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NumpyDataset {
#[prost(string, repeated, tag = "1")]
pub column_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub column_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bytes = "vec", repeated, tag = "3")]
pub column_data: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(int32, tag = "4")]
pub length: i32,
#[prost(message, repeated, tag = "5")]
pub data_shapes: ::prost::alloc::vec::Vec<DataShape>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRequest {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub data_shapes: ::prost::alloc::vec::Vec<DataShape>,
#[prost(string, tag = "3")]
pub row_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiCreateRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<CreateRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiQueryRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<QueryRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRequest {
#[prost(bool, tag = "1")]
pub is_sql_statement: bool,
#[prost(string, tag = "2")]
pub sql_statement: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub destination: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub key_category: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub epoch_start: i64,
#[prost(int64, tag = "6")]
pub epoch_start_nanos: i64,
#[prost(int64, tag = "7")]
pub epoch_end: i64,
#[prost(int64, tag = "8")]
pub epoch_end_nanos: i64,
#[prost(int32, tag = "9")]
pub limit_record_count: i32,
#[prost(bool, tag = "10")]
pub limit_from_start: bool,
#[prost(string, repeated, tag = "11")]
pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "12")]
pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiQueryResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<QueryResponse>,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub timezone: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<NumpyMultiDataset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiWriteRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<WriteRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRequest {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<NumpyMultiDataset>,
#[prost(bool, tag = "2")]
pub is_variable_length: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiServerResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<ServerResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerResponse {
#[prost(string, tag = "1")]
pub error: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiKeyRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<KeyRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyRequest {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSymbolsRequest {
#[prost(enumeration = "list_symbols_request::Format", tag = "1")]
pub format: i32,
}
pub mod list_symbols_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Format {
Symbol = 0,
TimeBucketKey = 1,
}
impl Format {
pub fn as_str_name(&self) -> &'static str {
match self {
Format::Symbol => "SYMBOL",
Format::TimeBucketKey => "TIME_BUCKET_KEY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SYMBOL" => Some(Self::Symbol),
"TIME_BUCKET_KEY" => Some(Self::TimeBucketKey),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSymbolsResponse {
#[prost(string, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerVersionRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerVersionResponse {
#[prost(string, tag = "1")]
pub version: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
Unknown = 0,
Float32 = 1,
Int32 = 2,
Float64 = 3,
Int64 = 4,
Epoch = 5,
Byte = 6,
Bool = 7,
None = 8,
String = 9,
Int16 = 10,
Uint8 = 11,
Uint16 = 12,
Uint32 = 13,
Uint64 = 14,
String16 = 15,
}
impl DataType {
pub fn as_str_name(&self) -> &'static str {
match self {
DataType::Unknown => "UNKNOWN",
DataType::Float32 => "FLOAT32",
DataType::Int32 => "INT32",
DataType::Float64 => "FLOAT64",
DataType::Int64 => "INT64",
DataType::Epoch => "EPOCH",
DataType::Byte => "BYTE",
DataType::Bool => "BOOL",
DataType::None => "NONE",
DataType::String => "STRING",
DataType::Int16 => "INT16",
DataType::Uint8 => "UINT8",
DataType::Uint16 => "UINT16",
DataType::Uint32 => "UINT32",
DataType::Uint64 => "UINT64",
DataType::String16 => "STRING16",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"FLOAT32" => Some(Self::Float32),
"INT32" => Some(Self::Int32),
"FLOAT64" => Some(Self::Float64),
"INT64" => Some(Self::Int64),
"EPOCH" => Some(Self::Epoch),
"BYTE" => Some(Self::Byte),
"BOOL" => Some(Self::Bool),
"NONE" => Some(Self::None),
"STRING" => Some(Self::String),
"INT16" => Some(Self::Int16),
"UINT8" => Some(Self::Uint8),
"UINT16" => Some(Self::Uint16),
"UINT32" => Some(Self::Uint32),
"UINT64" => Some(Self::Uint64),
"STRING16" => Some(Self::String16),
_ => None,
}
}
}
pub mod marketstore_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MarketstoreClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MarketstoreClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MarketstoreClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MarketstoreClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
MarketstoreClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn query(
&mut self,
request: impl tonic::IntoRequest<super::MultiQueryRequest>,
) -> Result<tonic::Response<super::MultiQueryResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Query");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::MultiCreateRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Create");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn write(
&mut self,
request: impl tonic::IntoRequest<super::MultiWriteRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Write");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn destroy(
&mut self,
request: impl tonic::IntoRequest<super::MultiKeyRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/Destroy",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list_symbols(
&mut self,
request: impl tonic::IntoRequest<super::ListSymbolsRequest>,
) -> Result<tonic::Response<super::ListSymbolsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/ListSymbols",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn server_version(
&mut self,
request: impl tonic::IntoRequest<super::ServerVersionRequest>,
) -> Result<tonic::Response<super::ServerVersionResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/ServerVersion",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}