1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct TenantContext {
6 #[prost(string, tag = "1")]
8 pub tenant_id: ::prost::alloc::string::String,
9 #[prost(string, optional, tag = "2")]
11 pub username: ::core::option::Option<::prost::alloc::string::String>,
12 #[prost(string, repeated, tag = "3")]
14 pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
15 #[prost(string, optional, tag = "4")]
17 pub trace_id: ::core::option::Option<::prost::alloc::string::String>,
18}
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
21pub struct GetClusterStateRequest {
22 #[prost(string, tag = "1")]
23 pub node_id: ::prost::alloc::string::String,
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct GetClusterStateResponse {
27 #[prost(message, repeated, tag = "1")]
28 pub nodes: ::prost::alloc::vec::Vec<ClusterNode>,
29 #[prost(map = "uint32, string", tag = "2")]
31 pub shard_to_node: ::std::collections::HashMap<u32, ::prost::alloc::string::String>,
32 #[prost(uint64, tag = "3")]
34 pub current_epoch: u64,
35 #[prost(map = "uint32, uint64", tag = "4")]
37 pub shard_epochs: ::std::collections::HashMap<u32, u64>,
38}
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct UpdateClusterStateRequest {
41 #[prost(message, optional, tag = "1")]
42 pub node: ::core::option::Option<ClusterNode>,
43 #[prost(message, repeated, tag = "2")]
44 pub shard_assignments: ::prost::alloc::vec::Vec<ShardAssignment>,
45}
46#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
47pub struct UpdateClusterStateResponse {
48 #[prost(bool, tag = "1")]
49 pub success: bool,
50 #[prost(string, tag = "2")]
51 pub message: ::prost::alloc::string::String,
52}
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct ClusterNode {
55 #[prost(string, tag = "1")]
56 pub id: ::prost::alloc::string::String,
57 #[prost(string, tag = "2")]
58 pub address: ::prost::alloc::string::String,
59 #[prost(uint32, tag = "3")]
60 pub grpc_port: u32,
61 #[prost(enumeration = "NodeStatus", tag = "4")]
62 pub status: i32,
63 #[prost(uint32, repeated, tag = "5")]
65 pub shards: ::prost::alloc::vec::Vec<u32>,
66 #[prost(message, optional, tag = "6")]
67 pub metadata: ::core::option::Option<NodeMetadata>,
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct NodeMetadata {
71 #[prost(string, optional, tag = "1")]
72 pub version: ::core::option::Option<::prost::alloc::string::String>,
73 #[prost(string, repeated, tag = "2")]
74 pub capabilities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
75 #[prost(uint64, tag = "3")]
76 pub vector_count: u64,
77 #[prost(uint64, tag = "4")]
78 pub memory_usage: u64,
79 #[prost(float, tag = "5")]
80 pub cpu_usage: f32,
81}
82#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
83pub struct ShardAssignment {
84 #[prost(uint32, tag = "1")]
85 pub shard_id: u32,
86 #[prost(string, tag = "2")]
87 pub node_id: ::prost::alloc::string::String,
88 #[prost(uint64, tag = "3")]
90 pub config_epoch: u64,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct RemoteInsertVectorRequest {
95 #[prost(string, tag = "1")]
96 pub collection_name: ::prost::alloc::string::String,
97 #[prost(string, tag = "2")]
98 pub vector_id: ::prost::alloc::string::String,
99 #[prost(float, repeated, tag = "3")]
100 pub vector: ::prost::alloc::vec::Vec<f32>,
101 #[prost(string, optional, tag = "4")]
102 pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
103 #[prost(message, optional, tag = "5")]
105 pub tenant: ::core::option::Option<TenantContext>,
106}
107#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
108pub struct RemoteInsertVectorResponse {
109 #[prost(bool, tag = "1")]
110 pub success: bool,
111 #[prost(string, tag = "2")]
112 pub message: ::prost::alloc::string::String,
113}
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct RemoteUpdateVectorRequest {
116 #[prost(string, tag = "1")]
117 pub collection_name: ::prost::alloc::string::String,
118 #[prost(string, tag = "2")]
119 pub vector_id: ::prost::alloc::string::String,
120 #[prost(float, repeated, tag = "3")]
121 pub vector: ::prost::alloc::vec::Vec<f32>,
122 #[prost(string, optional, tag = "4")]
123 pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
124 #[prost(message, optional, tag = "5")]
126 pub tenant: ::core::option::Option<TenantContext>,
127}
128#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
129pub struct RemoteUpdateVectorResponse {
130 #[prost(bool, tag = "1")]
131 pub success: bool,
132 #[prost(string, tag = "2")]
133 pub message: ::prost::alloc::string::String,
134}
135#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
136pub struct RemoteDeleteVectorRequest {
137 #[prost(string, tag = "1")]
138 pub collection_name: ::prost::alloc::string::String,
139 #[prost(string, tag = "2")]
140 pub vector_id: ::prost::alloc::string::String,
141 #[prost(message, optional, tag = "3")]
143 pub tenant: ::core::option::Option<TenantContext>,
144}
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct RemoteDeleteVectorResponse {
147 #[prost(bool, tag = "1")]
148 pub success: bool,
149 #[prost(string, tag = "2")]
150 pub message: ::prost::alloc::string::String,
151}
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct RemoteSearchVectorsRequest {
154 #[prost(string, tag = "1")]
155 pub collection_name: ::prost::alloc::string::String,
156 #[prost(float, repeated, tag = "2")]
157 pub query_vector: ::prost::alloc::vec::Vec<f32>,
158 #[prost(uint32, tag = "3")]
159 pub limit: u32,
160 #[prost(float, optional, tag = "4")]
161 pub threshold: ::core::option::Option<f32>,
162 #[prost(uint32, repeated, tag = "5")]
164 pub shard_ids: ::prost::alloc::vec::Vec<u32>,
165 #[prost(message, optional, tag = "6")]
167 pub tenant: ::core::option::Option<TenantContext>,
168}
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct RemoteSearchVectorsResponse {
171 #[prost(message, repeated, tag = "1")]
172 pub results: ::prost::alloc::vec::Vec<SearchResult>,
173 #[prost(bool, tag = "2")]
174 pub success: bool,
175 #[prost(string, tag = "3")]
176 pub message: ::prost::alloc::string::String,
177}
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct SearchResult {
180 #[prost(string, tag = "1")]
181 pub id: ::prost::alloc::string::String,
182 #[prost(float, tag = "2")]
183 pub score: f32,
184 #[prost(float, repeated, tag = "3")]
185 pub vector: ::prost::alloc::vec::Vec<f32>,
186 #[prost(string, optional, tag = "4")]
187 pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
188}
189#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct SparseVector {
196 #[prost(uint32, repeated, tag = "1")]
197 pub indices: ::prost::alloc::vec::Vec<u32>,
198 #[prost(float, repeated, tag = "2")]
199 pub values: ::prost::alloc::vec::Vec<f32>,
200}
201#[derive(Clone, Copy, PartialEq, ::prost::Message)]
202pub struct HybridSearchConfig {
203 #[prost(uint32, tag = "1")]
204 pub dense_k: u32,
205 #[prost(uint32, tag = "2")]
206 pub sparse_k: u32,
207 #[prost(uint32, tag = "3")]
208 pub final_k: u32,
209 #[prost(double, tag = "4")]
210 pub alpha: f64,
211 #[prost(enumeration = "HybridScoringAlgorithm", tag = "5")]
212 pub algorithm: i32,
213}
214#[derive(Clone, PartialEq, ::prost::Message)]
215pub struct RemoteHybridSearchRequest {
216 #[prost(string, tag = "1")]
217 pub collection_name: ::prost::alloc::string::String,
218 #[prost(float, repeated, tag = "2")]
219 pub dense_query: ::prost::alloc::vec::Vec<f32>,
220 #[prost(message, optional, tag = "3")]
222 pub sparse_query: ::core::option::Option<SparseVector>,
223 #[prost(message, optional, tag = "4")]
224 pub config: ::core::option::Option<HybridSearchConfig>,
225 #[prost(uint32, repeated, tag = "5")]
227 pub shard_ids: ::prost::alloc::vec::Vec<u32>,
228 #[prost(message, optional, tag = "6")]
230 pub tenant: ::core::option::Option<TenantContext>,
231}
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct HybridSearchResult {
234 #[prost(string, tag = "1")]
235 pub id: ::prost::alloc::string::String,
236 #[prost(float, tag = "2")]
237 pub hybrid_score: f32,
238 #[prost(float, optional, tag = "3")]
239 pub dense_score: ::core::option::Option<f32>,
240 #[prost(float, optional, tag = "4")]
241 pub sparse_score: ::core::option::Option<f32>,
242 #[prost(float, repeated, tag = "5")]
243 pub vector: ::prost::alloc::vec::Vec<f32>,
244 #[prost(string, optional, tag = "6")]
245 pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
246}
247#[derive(Clone, PartialEq, ::prost::Message)]
248pub struct RemoteHybridSearchResponse {
249 #[prost(message, repeated, tag = "1")]
250 pub results: ::prost::alloc::vec::Vec<HybridSearchResult>,
251 #[prost(bool, tag = "2")]
252 pub success: bool,
253 #[prost(string, tag = "3")]
254 pub message: ::prost::alloc::string::String,
255}
256#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
258pub struct RemoteCreateCollectionRequest {
259 #[prost(string, tag = "1")]
260 pub collection_name: ::prost::alloc::string::String,
261 #[prost(message, optional, tag = "2")]
262 pub config: ::core::option::Option<CollectionConfig>,
263 #[prost(message, optional, tag = "3")]
265 pub tenant: ::core::option::Option<TenantContext>,
266}
267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
268pub struct RemoteCreateCollectionResponse {
269 #[prost(bool, tag = "1")]
270 pub success: bool,
271 #[prost(string, tag = "2")]
272 pub message: ::prost::alloc::string::String,
273}
274#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
275pub struct RemoteGetCollectionInfoRequest {
276 #[prost(string, tag = "1")]
277 pub collection_name: ::prost::alloc::string::String,
278 #[prost(message, optional, tag = "2")]
280 pub tenant: ::core::option::Option<TenantContext>,
281}
282#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
283pub struct RemoteGetCollectionInfoResponse {
284 #[prost(message, optional, tag = "1")]
285 pub info: ::core::option::Option<CollectionInfo>,
286 #[prost(bool, tag = "2")]
287 pub success: bool,
288 #[prost(string, tag = "3")]
289 pub message: ::prost::alloc::string::String,
290}
291#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
292pub struct RemoteDeleteCollectionRequest {
293 #[prost(string, tag = "1")]
294 pub collection_name: ::prost::alloc::string::String,
295 #[prost(message, optional, tag = "2")]
297 pub tenant: ::core::option::Option<TenantContext>,
298}
299#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
300pub struct RemoteDeleteCollectionResponse {
301 #[prost(bool, tag = "1")]
302 pub success: bool,
303 #[prost(string, tag = "2")]
304 pub message: ::prost::alloc::string::String,
305}
306#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
308pub struct HealthCheckRequest {
309 #[prost(string, tag = "1")]
310 pub node_id: ::prost::alloc::string::String,
311}
312#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct HealthCheckResponse {
314 #[prost(bool, tag = "1")]
315 pub healthy: bool,
316 #[prost(string, tag = "2")]
317 pub message: ::prost::alloc::string::String,
318 #[prost(message, optional, tag = "3")]
319 pub metadata: ::core::option::Option<NodeMetadata>,
320}
321#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
323pub struct CheckQuotaRequest {
324 #[prost(message, optional, tag = "1")]
326 pub tenant: ::core::option::Option<TenantContext>,
327 #[prost(enumeration = "QuotaType", tag = "2")]
329 pub quota_type: i32,
330 #[prost(uint64, tag = "3")]
332 pub requested_amount: u64,
333}
334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
335pub struct CheckQuotaResponse {
336 #[prost(bool, tag = "1")]
338 pub allowed: bool,
339 #[prost(uint64, tag = "2")]
341 pub current_usage: u64,
342 #[prost(uint64, tag = "3")]
344 pub limit: u64,
345 #[prost(uint64, tag = "4")]
347 pub remaining: u64,
348 #[prost(string, tag = "5")]
350 pub message: ::prost::alloc::string::String,
351}
352#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
354pub struct GetShardVectorsRequest {
355 #[prost(string, tag = "1")]
357 pub collection_name: ::prost::alloc::string::String,
358 #[prost(uint32, tag = "2")]
360 pub shard_id: u32,
361 #[prost(uint32, tag = "3")]
363 pub offset: u32,
364 #[prost(uint32, tag = "4")]
366 pub limit: u32,
367 #[prost(message, optional, tag = "5")]
369 pub tenant: ::core::option::Option<TenantContext>,
370}
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct GetShardVectorsResponse {
373 #[prost(message, repeated, tag = "1")]
375 pub vectors: ::prost::alloc::vec::Vec<VectorData>,
376 #[prost(uint32, tag = "2")]
378 pub total_count: u32,
379 #[prost(bool, tag = "3")]
381 pub has_more: bool,
382}
383#[derive(Clone, PartialEq, ::prost::Message)]
384pub struct VectorData {
385 #[prost(string, tag = "1")]
387 pub id: ::prost::alloc::string::String,
388 #[prost(float, repeated, tag = "2")]
390 pub vector: ::prost::alloc::vec::Vec<f32>,
391 #[prost(string, optional, tag = "3")]
393 pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
394}
395#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
397pub struct CollectionConfig {
398 #[prost(uint32, tag = "1")]
399 pub dimension: u32,
400 #[prost(string, tag = "2")]
402 pub metric: ::prost::alloc::string::String,
403}
404#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
405pub struct CollectionInfo {
406 #[prost(string, tag = "1")]
407 pub name: ::prost::alloc::string::String,
408 #[prost(uint64, tag = "2")]
409 pub vector_count: u64,
410 #[prost(uint64, tag = "3")]
412 pub document_count: u64,
413}
414#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
415pub struct RaftVoteRequest {
416 #[prost(bytes = "vec", tag = "1")]
418 pub data: ::prost::alloc::vec::Vec<u8>,
419}
420#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
421pub struct RaftVoteResponse {
422 #[prost(bytes = "vec", tag = "1")]
424 pub data: ::prost::alloc::vec::Vec<u8>,
425}
426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
427pub struct RaftAppendEntriesRequest {
428 #[prost(bytes = "vec", tag = "1")]
430 pub data: ::prost::alloc::vec::Vec<u8>,
431}
432#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
433pub struct RaftAppendEntriesResponse {
434 #[prost(bytes = "vec", tag = "1")]
436 pub data: ::prost::alloc::vec::Vec<u8>,
437}
438#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
439pub struct RaftSnapshotRequest {
440 #[prost(bytes = "vec", tag = "1")]
441 pub vote_data: ::prost::alloc::vec::Vec<u8>,
442 #[prost(bytes = "vec", tag = "2")]
443 pub snapshot_meta: ::prost::alloc::vec::Vec<u8>,
444 #[prost(bytes = "vec", tag = "3")]
445 pub snapshot_data: ::prost::alloc::vec::Vec<u8>,
446}
447#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
448pub struct RaftSnapshotResponse {
449 #[prost(bytes = "vec", tag = "1")]
450 pub data: ::prost::alloc::vec::Vec<u8>,
451}
452#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
453#[repr(i32)]
454pub enum NodeStatus {
455 Active = 0,
456 Joining = 1,
457 Leaving = 2,
458 Unavailable = 3,
459}
460impl NodeStatus {
461 pub fn as_str_name(&self) -> &'static str {
466 match self {
467 Self::Active => "ACTIVE",
468 Self::Joining => "JOINING",
469 Self::Leaving => "LEAVING",
470 Self::Unavailable => "UNAVAILABLE",
471 }
472 }
473 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
475 match value {
476 "ACTIVE" => Some(Self::Active),
477 "JOINING" => Some(Self::Joining),
478 "LEAVING" => Some(Self::Leaving),
479 "UNAVAILABLE" => Some(Self::Unavailable),
480 _ => None,
481 }
482 }
483}
484#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
485#[repr(i32)]
486pub enum HybridScoringAlgorithm {
487 HybridScoringRrf = 0,
488 HybridScoringWeighted = 1,
489 HybridScoringAlphaBlend = 2,
490}
491impl HybridScoringAlgorithm {
492 pub fn as_str_name(&self) -> &'static str {
497 match self {
498 Self::HybridScoringRrf => "HYBRID_SCORING_RRF",
499 Self::HybridScoringWeighted => "HYBRID_SCORING_WEIGHTED",
500 Self::HybridScoringAlphaBlend => "HYBRID_SCORING_ALPHA_BLEND",
501 }
502 }
503 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
505 match value {
506 "HYBRID_SCORING_RRF" => Some(Self::HybridScoringRrf),
507 "HYBRID_SCORING_WEIGHTED" => Some(Self::HybridScoringWeighted),
508 "HYBRID_SCORING_ALPHA_BLEND" => Some(Self::HybridScoringAlphaBlend),
509 _ => None,
510 }
511 }
512}
513#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
514#[repr(i32)]
515pub enum QuotaType {
516 QuotaCollections = 0,
517 QuotaVectors = 1,
518 QuotaStorage = 2,
519}
520impl QuotaType {
521 pub fn as_str_name(&self) -> &'static str {
526 match self {
527 Self::QuotaCollections => "QUOTA_COLLECTIONS",
528 Self::QuotaVectors => "QUOTA_VECTORS",
529 Self::QuotaStorage => "QUOTA_STORAGE",
530 }
531 }
532 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
534 match value {
535 "QUOTA_COLLECTIONS" => Some(Self::QuotaCollections),
536 "QUOTA_VECTORS" => Some(Self::QuotaVectors),
537 "QUOTA_STORAGE" => Some(Self::QuotaStorage),
538 _ => None,
539 }
540 }
541}
542pub mod cluster_service_client {
544 #![allow(
545 unused_variables,
546 dead_code,
547 missing_docs,
548 clippy::wildcard_imports,
549 clippy::let_unit_value,
550 )]
551 use tonic::codegen::*;
552 use tonic::codegen::http::Uri;
553 #[derive(Debug, Clone)]
555 pub struct ClusterServiceClient<T> {
556 inner: tonic::client::Grpc<T>,
557 }
558 impl ClusterServiceClient<tonic::transport::Channel> {
559 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
561 where
562 D: TryInto<tonic::transport::Endpoint>,
563 D::Error: Into<StdError>,
564 {
565 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
566 Ok(Self::new(conn))
567 }
568 }
569 impl<T> ClusterServiceClient<T>
570 where
571 T: tonic::client::GrpcService<tonic::body::Body>,
572 T::Error: Into<StdError>,
573 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
574 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
575 {
576 pub fn new(inner: T) -> Self {
577 let inner = tonic::client::Grpc::new(inner);
578 Self { inner }
579 }
580 pub fn with_origin(inner: T, origin: Uri) -> Self {
581 let inner = tonic::client::Grpc::with_origin(inner, origin);
582 Self { inner }
583 }
584 pub fn with_interceptor<F>(
585 inner: T,
586 interceptor: F,
587 ) -> ClusterServiceClient<InterceptedService<T, F>>
588 where
589 F: tonic::service::Interceptor,
590 T::ResponseBody: Default,
591 T: tonic::codegen::Service<
592 http::Request<tonic::body::Body>,
593 Response = http::Response<
594 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
595 >,
596 >,
597 <T as tonic::codegen::Service<
598 http::Request<tonic::body::Body>,
599 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
600 {
601 ClusterServiceClient::new(InterceptedService::new(inner, interceptor))
602 }
603 #[must_use]
608 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
609 self.inner = self.inner.send_compressed(encoding);
610 self
611 }
612 #[must_use]
614 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
615 self.inner = self.inner.accept_compressed(encoding);
616 self
617 }
618 #[must_use]
622 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
623 self.inner = self.inner.max_decoding_message_size(limit);
624 self
625 }
626 #[must_use]
630 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
631 self.inner = self.inner.max_encoding_message_size(limit);
632 self
633 }
634 pub async fn get_cluster_state(
636 &mut self,
637 request: impl tonic::IntoRequest<super::GetClusterStateRequest>,
638 ) -> std::result::Result<
639 tonic::Response<super::GetClusterStateResponse>,
640 tonic::Status,
641 > {
642 self.inner
643 .ready()
644 .await
645 .map_err(|e| {
646 tonic::Status::unknown(
647 format!("Service was not ready: {}", e.into()),
648 )
649 })?;
650 let codec = tonic_prost::ProstCodec::default();
651 let path = http::uri::PathAndQuery::from_static(
652 "/vectorizer.cluster.ClusterService/GetClusterState",
653 );
654 let mut req = request.into_request();
655 req.extensions_mut()
656 .insert(
657 GrpcMethod::new(
658 "vectorizer.cluster.ClusterService",
659 "GetClusterState",
660 ),
661 );
662 self.inner.unary(req, path, codec).await
663 }
664 pub async fn update_cluster_state(
666 &mut self,
667 request: impl tonic::IntoRequest<super::UpdateClusterStateRequest>,
668 ) -> std::result::Result<
669 tonic::Response<super::UpdateClusterStateResponse>,
670 tonic::Status,
671 > {
672 self.inner
673 .ready()
674 .await
675 .map_err(|e| {
676 tonic::Status::unknown(
677 format!("Service was not ready: {}", e.into()),
678 )
679 })?;
680 let codec = tonic_prost::ProstCodec::default();
681 let path = http::uri::PathAndQuery::from_static(
682 "/vectorizer.cluster.ClusterService/UpdateClusterState",
683 );
684 let mut req = request.into_request();
685 req.extensions_mut()
686 .insert(
687 GrpcMethod::new(
688 "vectorizer.cluster.ClusterService",
689 "UpdateClusterState",
690 ),
691 );
692 self.inner.unary(req, path, codec).await
693 }
694 pub async fn remote_insert_vector(
696 &mut self,
697 request: impl tonic::IntoRequest<super::RemoteInsertVectorRequest>,
698 ) -> std::result::Result<
699 tonic::Response<super::RemoteInsertVectorResponse>,
700 tonic::Status,
701 > {
702 self.inner
703 .ready()
704 .await
705 .map_err(|e| {
706 tonic::Status::unknown(
707 format!("Service was not ready: {}", e.into()),
708 )
709 })?;
710 let codec = tonic_prost::ProstCodec::default();
711 let path = http::uri::PathAndQuery::from_static(
712 "/vectorizer.cluster.ClusterService/RemoteInsertVector",
713 );
714 let mut req = request.into_request();
715 req.extensions_mut()
716 .insert(
717 GrpcMethod::new(
718 "vectorizer.cluster.ClusterService",
719 "RemoteInsertVector",
720 ),
721 );
722 self.inner.unary(req, path, codec).await
723 }
724 pub async fn remote_update_vector(
725 &mut self,
726 request: impl tonic::IntoRequest<super::RemoteUpdateVectorRequest>,
727 ) -> std::result::Result<
728 tonic::Response<super::RemoteUpdateVectorResponse>,
729 tonic::Status,
730 > {
731 self.inner
732 .ready()
733 .await
734 .map_err(|e| {
735 tonic::Status::unknown(
736 format!("Service was not ready: {}", e.into()),
737 )
738 })?;
739 let codec = tonic_prost::ProstCodec::default();
740 let path = http::uri::PathAndQuery::from_static(
741 "/vectorizer.cluster.ClusterService/RemoteUpdateVector",
742 );
743 let mut req = request.into_request();
744 req.extensions_mut()
745 .insert(
746 GrpcMethod::new(
747 "vectorizer.cluster.ClusterService",
748 "RemoteUpdateVector",
749 ),
750 );
751 self.inner.unary(req, path, codec).await
752 }
753 pub async fn remote_delete_vector(
754 &mut self,
755 request: impl tonic::IntoRequest<super::RemoteDeleteVectorRequest>,
756 ) -> std::result::Result<
757 tonic::Response<super::RemoteDeleteVectorResponse>,
758 tonic::Status,
759 > {
760 self.inner
761 .ready()
762 .await
763 .map_err(|e| {
764 tonic::Status::unknown(
765 format!("Service was not ready: {}", e.into()),
766 )
767 })?;
768 let codec = tonic_prost::ProstCodec::default();
769 let path = http::uri::PathAndQuery::from_static(
770 "/vectorizer.cluster.ClusterService/RemoteDeleteVector",
771 );
772 let mut req = request.into_request();
773 req.extensions_mut()
774 .insert(
775 GrpcMethod::new(
776 "vectorizer.cluster.ClusterService",
777 "RemoteDeleteVector",
778 ),
779 );
780 self.inner.unary(req, path, codec).await
781 }
782 pub async fn remote_search_vectors(
783 &mut self,
784 request: impl tonic::IntoRequest<super::RemoteSearchVectorsRequest>,
785 ) -> std::result::Result<
786 tonic::Response<super::RemoteSearchVectorsResponse>,
787 tonic::Status,
788 > {
789 self.inner
790 .ready()
791 .await
792 .map_err(|e| {
793 tonic::Status::unknown(
794 format!("Service was not ready: {}", e.into()),
795 )
796 })?;
797 let codec = tonic_prost::ProstCodec::default();
798 let path = http::uri::PathAndQuery::from_static(
799 "/vectorizer.cluster.ClusterService/RemoteSearchVectors",
800 );
801 let mut req = request.into_request();
802 req.extensions_mut()
803 .insert(
804 GrpcMethod::new(
805 "vectorizer.cluster.ClusterService",
806 "RemoteSearchVectors",
807 ),
808 );
809 self.inner.unary(req, path, codec).await
810 }
811 pub async fn remote_hybrid_search(
812 &mut self,
813 request: impl tonic::IntoRequest<super::RemoteHybridSearchRequest>,
814 ) -> std::result::Result<
815 tonic::Response<super::RemoteHybridSearchResponse>,
816 tonic::Status,
817 > {
818 self.inner
819 .ready()
820 .await
821 .map_err(|e| {
822 tonic::Status::unknown(
823 format!("Service was not ready: {}", e.into()),
824 )
825 })?;
826 let codec = tonic_prost::ProstCodec::default();
827 let path = http::uri::PathAndQuery::from_static(
828 "/vectorizer.cluster.ClusterService/RemoteHybridSearch",
829 );
830 let mut req = request.into_request();
831 req.extensions_mut()
832 .insert(
833 GrpcMethod::new(
834 "vectorizer.cluster.ClusterService",
835 "RemoteHybridSearch",
836 ),
837 );
838 self.inner.unary(req, path, codec).await
839 }
840 pub async fn remote_create_collection(
842 &mut self,
843 request: impl tonic::IntoRequest<super::RemoteCreateCollectionRequest>,
844 ) -> std::result::Result<
845 tonic::Response<super::RemoteCreateCollectionResponse>,
846 tonic::Status,
847 > {
848 self.inner
849 .ready()
850 .await
851 .map_err(|e| {
852 tonic::Status::unknown(
853 format!("Service was not ready: {}", e.into()),
854 )
855 })?;
856 let codec = tonic_prost::ProstCodec::default();
857 let path = http::uri::PathAndQuery::from_static(
858 "/vectorizer.cluster.ClusterService/RemoteCreateCollection",
859 );
860 let mut req = request.into_request();
861 req.extensions_mut()
862 .insert(
863 GrpcMethod::new(
864 "vectorizer.cluster.ClusterService",
865 "RemoteCreateCollection",
866 ),
867 );
868 self.inner.unary(req, path, codec).await
869 }
870 pub async fn remote_get_collection_info(
871 &mut self,
872 request: impl tonic::IntoRequest<super::RemoteGetCollectionInfoRequest>,
873 ) -> std::result::Result<
874 tonic::Response<super::RemoteGetCollectionInfoResponse>,
875 tonic::Status,
876 > {
877 self.inner
878 .ready()
879 .await
880 .map_err(|e| {
881 tonic::Status::unknown(
882 format!("Service was not ready: {}", e.into()),
883 )
884 })?;
885 let codec = tonic_prost::ProstCodec::default();
886 let path = http::uri::PathAndQuery::from_static(
887 "/vectorizer.cluster.ClusterService/RemoteGetCollectionInfo",
888 );
889 let mut req = request.into_request();
890 req.extensions_mut()
891 .insert(
892 GrpcMethod::new(
893 "vectorizer.cluster.ClusterService",
894 "RemoteGetCollectionInfo",
895 ),
896 );
897 self.inner.unary(req, path, codec).await
898 }
899 pub async fn remote_delete_collection(
900 &mut self,
901 request: impl tonic::IntoRequest<super::RemoteDeleteCollectionRequest>,
902 ) -> std::result::Result<
903 tonic::Response<super::RemoteDeleteCollectionResponse>,
904 tonic::Status,
905 > {
906 self.inner
907 .ready()
908 .await
909 .map_err(|e| {
910 tonic::Status::unknown(
911 format!("Service was not ready: {}", e.into()),
912 )
913 })?;
914 let codec = tonic_prost::ProstCodec::default();
915 let path = http::uri::PathAndQuery::from_static(
916 "/vectorizer.cluster.ClusterService/RemoteDeleteCollection",
917 );
918 let mut req = request.into_request();
919 req.extensions_mut()
920 .insert(
921 GrpcMethod::new(
922 "vectorizer.cluster.ClusterService",
923 "RemoteDeleteCollection",
924 ),
925 );
926 self.inner.unary(req, path, codec).await
927 }
928 pub async fn health_check(
930 &mut self,
931 request: impl tonic::IntoRequest<super::HealthCheckRequest>,
932 ) -> std::result::Result<
933 tonic::Response<super::HealthCheckResponse>,
934 tonic::Status,
935 > {
936 self.inner
937 .ready()
938 .await
939 .map_err(|e| {
940 tonic::Status::unknown(
941 format!("Service was not ready: {}", e.into()),
942 )
943 })?;
944 let codec = tonic_prost::ProstCodec::default();
945 let path = http::uri::PathAndQuery::from_static(
946 "/vectorizer.cluster.ClusterService/HealthCheck",
947 );
948 let mut req = request.into_request();
949 req.extensions_mut()
950 .insert(
951 GrpcMethod::new("vectorizer.cluster.ClusterService", "HealthCheck"),
952 );
953 self.inner.unary(req, path, codec).await
954 }
955 pub async fn check_quota(
957 &mut self,
958 request: impl tonic::IntoRequest<super::CheckQuotaRequest>,
959 ) -> std::result::Result<
960 tonic::Response<super::CheckQuotaResponse>,
961 tonic::Status,
962 > {
963 self.inner
964 .ready()
965 .await
966 .map_err(|e| {
967 tonic::Status::unknown(
968 format!("Service was not ready: {}", e.into()),
969 )
970 })?;
971 let codec = tonic_prost::ProstCodec::default();
972 let path = http::uri::PathAndQuery::from_static(
973 "/vectorizer.cluster.ClusterService/CheckQuota",
974 );
975 let mut req = request.into_request();
976 req.extensions_mut()
977 .insert(
978 GrpcMethod::new("vectorizer.cluster.ClusterService", "CheckQuota"),
979 );
980 self.inner.unary(req, path, codec).await
981 }
982 pub async fn get_shard_vectors(
984 &mut self,
985 request: impl tonic::IntoRequest<super::GetShardVectorsRequest>,
986 ) -> std::result::Result<
987 tonic::Response<super::GetShardVectorsResponse>,
988 tonic::Status,
989 > {
990 self.inner
991 .ready()
992 .await
993 .map_err(|e| {
994 tonic::Status::unknown(
995 format!("Service was not ready: {}", e.into()),
996 )
997 })?;
998 let codec = tonic_prost::ProstCodec::default();
999 let path = http::uri::PathAndQuery::from_static(
1000 "/vectorizer.cluster.ClusterService/GetShardVectors",
1001 );
1002 let mut req = request.into_request();
1003 req.extensions_mut()
1004 .insert(
1005 GrpcMethod::new(
1006 "vectorizer.cluster.ClusterService",
1007 "GetShardVectors",
1008 ),
1009 );
1010 self.inner.unary(req, path, codec).await
1011 }
1012 pub async fn raft_vote(
1014 &mut self,
1015 request: impl tonic::IntoRequest<super::RaftVoteRequest>,
1016 ) -> std::result::Result<
1017 tonic::Response<super::RaftVoteResponse>,
1018 tonic::Status,
1019 > {
1020 self.inner
1021 .ready()
1022 .await
1023 .map_err(|e| {
1024 tonic::Status::unknown(
1025 format!("Service was not ready: {}", e.into()),
1026 )
1027 })?;
1028 let codec = tonic_prost::ProstCodec::default();
1029 let path = http::uri::PathAndQuery::from_static(
1030 "/vectorizer.cluster.ClusterService/RaftVote",
1031 );
1032 let mut req = request.into_request();
1033 req.extensions_mut()
1034 .insert(
1035 GrpcMethod::new("vectorizer.cluster.ClusterService", "RaftVote"),
1036 );
1037 self.inner.unary(req, path, codec).await
1038 }
1039 pub async fn raft_append_entries(
1040 &mut self,
1041 request: impl tonic::IntoRequest<super::RaftAppendEntriesRequest>,
1042 ) -> std::result::Result<
1043 tonic::Response<super::RaftAppendEntriesResponse>,
1044 tonic::Status,
1045 > {
1046 self.inner
1047 .ready()
1048 .await
1049 .map_err(|e| {
1050 tonic::Status::unknown(
1051 format!("Service was not ready: {}", e.into()),
1052 )
1053 })?;
1054 let codec = tonic_prost::ProstCodec::default();
1055 let path = http::uri::PathAndQuery::from_static(
1056 "/vectorizer.cluster.ClusterService/RaftAppendEntries",
1057 );
1058 let mut req = request.into_request();
1059 req.extensions_mut()
1060 .insert(
1061 GrpcMethod::new(
1062 "vectorizer.cluster.ClusterService",
1063 "RaftAppendEntries",
1064 ),
1065 );
1066 self.inner.unary(req, path, codec).await
1067 }
1068 pub async fn raft_snapshot(
1069 &mut self,
1070 request: impl tonic::IntoRequest<super::RaftSnapshotRequest>,
1071 ) -> std::result::Result<
1072 tonic::Response<super::RaftSnapshotResponse>,
1073 tonic::Status,
1074 > {
1075 self.inner
1076 .ready()
1077 .await
1078 .map_err(|e| {
1079 tonic::Status::unknown(
1080 format!("Service was not ready: {}", e.into()),
1081 )
1082 })?;
1083 let codec = tonic_prost::ProstCodec::default();
1084 let path = http::uri::PathAndQuery::from_static(
1085 "/vectorizer.cluster.ClusterService/RaftSnapshot",
1086 );
1087 let mut req = request.into_request();
1088 req.extensions_mut()
1089 .insert(
1090 GrpcMethod::new("vectorizer.cluster.ClusterService", "RaftSnapshot"),
1091 );
1092 self.inner.unary(req, path, codec).await
1093 }
1094 }
1095}
1096pub mod cluster_service_server {
1098 #![allow(
1099 unused_variables,
1100 dead_code,
1101 missing_docs,
1102 clippy::wildcard_imports,
1103 clippy::let_unit_value,
1104 )]
1105 use tonic::codegen::*;
1106 #[async_trait]
1108 pub trait ClusterService: std::marker::Send + std::marker::Sync + 'static {
1109 async fn get_cluster_state(
1111 &self,
1112 request: tonic::Request<super::GetClusterStateRequest>,
1113 ) -> std::result::Result<
1114 tonic::Response<super::GetClusterStateResponse>,
1115 tonic::Status,
1116 >;
1117 async fn update_cluster_state(
1119 &self,
1120 request: tonic::Request<super::UpdateClusterStateRequest>,
1121 ) -> std::result::Result<
1122 tonic::Response<super::UpdateClusterStateResponse>,
1123 tonic::Status,
1124 >;
1125 async fn remote_insert_vector(
1127 &self,
1128 request: tonic::Request<super::RemoteInsertVectorRequest>,
1129 ) -> std::result::Result<
1130 tonic::Response<super::RemoteInsertVectorResponse>,
1131 tonic::Status,
1132 >;
1133 async fn remote_update_vector(
1134 &self,
1135 request: tonic::Request<super::RemoteUpdateVectorRequest>,
1136 ) -> std::result::Result<
1137 tonic::Response<super::RemoteUpdateVectorResponse>,
1138 tonic::Status,
1139 >;
1140 async fn remote_delete_vector(
1141 &self,
1142 request: tonic::Request<super::RemoteDeleteVectorRequest>,
1143 ) -> std::result::Result<
1144 tonic::Response<super::RemoteDeleteVectorResponse>,
1145 tonic::Status,
1146 >;
1147 async fn remote_search_vectors(
1148 &self,
1149 request: tonic::Request<super::RemoteSearchVectorsRequest>,
1150 ) -> std::result::Result<
1151 tonic::Response<super::RemoteSearchVectorsResponse>,
1152 tonic::Status,
1153 >;
1154 async fn remote_hybrid_search(
1155 &self,
1156 request: tonic::Request<super::RemoteHybridSearchRequest>,
1157 ) -> std::result::Result<
1158 tonic::Response<super::RemoteHybridSearchResponse>,
1159 tonic::Status,
1160 >;
1161 async fn remote_create_collection(
1163 &self,
1164 request: tonic::Request<super::RemoteCreateCollectionRequest>,
1165 ) -> std::result::Result<
1166 tonic::Response<super::RemoteCreateCollectionResponse>,
1167 tonic::Status,
1168 >;
1169 async fn remote_get_collection_info(
1170 &self,
1171 request: tonic::Request<super::RemoteGetCollectionInfoRequest>,
1172 ) -> std::result::Result<
1173 tonic::Response<super::RemoteGetCollectionInfoResponse>,
1174 tonic::Status,
1175 >;
1176 async fn remote_delete_collection(
1177 &self,
1178 request: tonic::Request<super::RemoteDeleteCollectionRequest>,
1179 ) -> std::result::Result<
1180 tonic::Response<super::RemoteDeleteCollectionResponse>,
1181 tonic::Status,
1182 >;
1183 async fn health_check(
1185 &self,
1186 request: tonic::Request<super::HealthCheckRequest>,
1187 ) -> std::result::Result<
1188 tonic::Response<super::HealthCheckResponse>,
1189 tonic::Status,
1190 >;
1191 async fn check_quota(
1193 &self,
1194 request: tonic::Request<super::CheckQuotaRequest>,
1195 ) -> std::result::Result<
1196 tonic::Response<super::CheckQuotaResponse>,
1197 tonic::Status,
1198 >;
1199 async fn get_shard_vectors(
1201 &self,
1202 request: tonic::Request<super::GetShardVectorsRequest>,
1203 ) -> std::result::Result<
1204 tonic::Response<super::GetShardVectorsResponse>,
1205 tonic::Status,
1206 >;
1207 async fn raft_vote(
1209 &self,
1210 request: tonic::Request<super::RaftVoteRequest>,
1211 ) -> std::result::Result<
1212 tonic::Response<super::RaftVoteResponse>,
1213 tonic::Status,
1214 >;
1215 async fn raft_append_entries(
1216 &self,
1217 request: tonic::Request<super::RaftAppendEntriesRequest>,
1218 ) -> std::result::Result<
1219 tonic::Response<super::RaftAppendEntriesResponse>,
1220 tonic::Status,
1221 >;
1222 async fn raft_snapshot(
1223 &self,
1224 request: tonic::Request<super::RaftSnapshotRequest>,
1225 ) -> std::result::Result<
1226 tonic::Response<super::RaftSnapshotResponse>,
1227 tonic::Status,
1228 >;
1229 }
1230 #[derive(Debug)]
1232 pub struct ClusterServiceServer<T> {
1233 inner: Arc<T>,
1234 accept_compression_encodings: EnabledCompressionEncodings,
1235 send_compression_encodings: EnabledCompressionEncodings,
1236 max_decoding_message_size: Option<usize>,
1237 max_encoding_message_size: Option<usize>,
1238 }
1239 impl<T> ClusterServiceServer<T> {
1240 pub fn new(inner: T) -> Self {
1241 Self::from_arc(Arc::new(inner))
1242 }
1243 pub fn from_arc(inner: Arc<T>) -> Self {
1244 Self {
1245 inner,
1246 accept_compression_encodings: Default::default(),
1247 send_compression_encodings: Default::default(),
1248 max_decoding_message_size: None,
1249 max_encoding_message_size: None,
1250 }
1251 }
1252 pub fn with_interceptor<F>(
1253 inner: T,
1254 interceptor: F,
1255 ) -> InterceptedService<Self, F>
1256 where
1257 F: tonic::service::Interceptor,
1258 {
1259 InterceptedService::new(Self::new(inner), interceptor)
1260 }
1261 #[must_use]
1263 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1264 self.accept_compression_encodings.enable(encoding);
1265 self
1266 }
1267 #[must_use]
1269 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1270 self.send_compression_encodings.enable(encoding);
1271 self
1272 }
1273 #[must_use]
1277 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1278 self.max_decoding_message_size = Some(limit);
1279 self
1280 }
1281 #[must_use]
1285 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1286 self.max_encoding_message_size = Some(limit);
1287 self
1288 }
1289 }
1290 impl<T, B> tonic::codegen::Service<http::Request<B>> for ClusterServiceServer<T>
1291 where
1292 T: ClusterService,
1293 B: Body + std::marker::Send + 'static,
1294 B::Error: Into<StdError> + std::marker::Send + 'static,
1295 {
1296 type Response = http::Response<tonic::body::Body>;
1297 type Error = std::convert::Infallible;
1298 type Future = BoxFuture<Self::Response, Self::Error>;
1299 fn poll_ready(
1300 &mut self,
1301 _cx: &mut Context<'_>,
1302 ) -> Poll<std::result::Result<(), Self::Error>> {
1303 Poll::Ready(Ok(()))
1304 }
1305 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1306 match req.uri().path() {
1307 "/vectorizer.cluster.ClusterService/GetClusterState" => {
1308 #[allow(non_camel_case_types)]
1309 struct GetClusterStateSvc<T: ClusterService>(pub Arc<T>);
1310 impl<
1311 T: ClusterService,
1312 > tonic::server::UnaryService<super::GetClusterStateRequest>
1313 for GetClusterStateSvc<T> {
1314 type Response = super::GetClusterStateResponse;
1315 type Future = BoxFuture<
1316 tonic::Response<Self::Response>,
1317 tonic::Status,
1318 >;
1319 fn call(
1320 &mut self,
1321 request: tonic::Request<super::GetClusterStateRequest>,
1322 ) -> Self::Future {
1323 let inner = Arc::clone(&self.0);
1324 let fut = async move {
1325 <T as ClusterService>::get_cluster_state(&inner, request)
1326 .await
1327 };
1328 Box::pin(fut)
1329 }
1330 }
1331 let accept_compression_encodings = self.accept_compression_encodings;
1332 let send_compression_encodings = self.send_compression_encodings;
1333 let max_decoding_message_size = self.max_decoding_message_size;
1334 let max_encoding_message_size = self.max_encoding_message_size;
1335 let inner = self.inner.clone();
1336 let fut = async move {
1337 let method = GetClusterStateSvc(inner);
1338 let codec = tonic_prost::ProstCodec::default();
1339 let mut grpc = tonic::server::Grpc::new(codec)
1340 .apply_compression_config(
1341 accept_compression_encodings,
1342 send_compression_encodings,
1343 )
1344 .apply_max_message_size_config(
1345 max_decoding_message_size,
1346 max_encoding_message_size,
1347 );
1348 let res = grpc.unary(method, req).await;
1349 Ok(res)
1350 };
1351 Box::pin(fut)
1352 }
1353 "/vectorizer.cluster.ClusterService/UpdateClusterState" => {
1354 #[allow(non_camel_case_types)]
1355 struct UpdateClusterStateSvc<T: ClusterService>(pub Arc<T>);
1356 impl<
1357 T: ClusterService,
1358 > tonic::server::UnaryService<super::UpdateClusterStateRequest>
1359 for UpdateClusterStateSvc<T> {
1360 type Response = super::UpdateClusterStateResponse;
1361 type Future = BoxFuture<
1362 tonic::Response<Self::Response>,
1363 tonic::Status,
1364 >;
1365 fn call(
1366 &mut self,
1367 request: tonic::Request<super::UpdateClusterStateRequest>,
1368 ) -> Self::Future {
1369 let inner = Arc::clone(&self.0);
1370 let fut = async move {
1371 <T as ClusterService>::update_cluster_state(&inner, request)
1372 .await
1373 };
1374 Box::pin(fut)
1375 }
1376 }
1377 let accept_compression_encodings = self.accept_compression_encodings;
1378 let send_compression_encodings = self.send_compression_encodings;
1379 let max_decoding_message_size = self.max_decoding_message_size;
1380 let max_encoding_message_size = self.max_encoding_message_size;
1381 let inner = self.inner.clone();
1382 let fut = async move {
1383 let method = UpdateClusterStateSvc(inner);
1384 let codec = tonic_prost::ProstCodec::default();
1385 let mut grpc = tonic::server::Grpc::new(codec)
1386 .apply_compression_config(
1387 accept_compression_encodings,
1388 send_compression_encodings,
1389 )
1390 .apply_max_message_size_config(
1391 max_decoding_message_size,
1392 max_encoding_message_size,
1393 );
1394 let res = grpc.unary(method, req).await;
1395 Ok(res)
1396 };
1397 Box::pin(fut)
1398 }
1399 "/vectorizer.cluster.ClusterService/RemoteInsertVector" => {
1400 #[allow(non_camel_case_types)]
1401 struct RemoteInsertVectorSvc<T: ClusterService>(pub Arc<T>);
1402 impl<
1403 T: ClusterService,
1404 > tonic::server::UnaryService<super::RemoteInsertVectorRequest>
1405 for RemoteInsertVectorSvc<T> {
1406 type Response = super::RemoteInsertVectorResponse;
1407 type Future = BoxFuture<
1408 tonic::Response<Self::Response>,
1409 tonic::Status,
1410 >;
1411 fn call(
1412 &mut self,
1413 request: tonic::Request<super::RemoteInsertVectorRequest>,
1414 ) -> Self::Future {
1415 let inner = Arc::clone(&self.0);
1416 let fut = async move {
1417 <T as ClusterService>::remote_insert_vector(&inner, request)
1418 .await
1419 };
1420 Box::pin(fut)
1421 }
1422 }
1423 let accept_compression_encodings = self.accept_compression_encodings;
1424 let send_compression_encodings = self.send_compression_encodings;
1425 let max_decoding_message_size = self.max_decoding_message_size;
1426 let max_encoding_message_size = self.max_encoding_message_size;
1427 let inner = self.inner.clone();
1428 let fut = async move {
1429 let method = RemoteInsertVectorSvc(inner);
1430 let codec = tonic_prost::ProstCodec::default();
1431 let mut grpc = tonic::server::Grpc::new(codec)
1432 .apply_compression_config(
1433 accept_compression_encodings,
1434 send_compression_encodings,
1435 )
1436 .apply_max_message_size_config(
1437 max_decoding_message_size,
1438 max_encoding_message_size,
1439 );
1440 let res = grpc.unary(method, req).await;
1441 Ok(res)
1442 };
1443 Box::pin(fut)
1444 }
1445 "/vectorizer.cluster.ClusterService/RemoteUpdateVector" => {
1446 #[allow(non_camel_case_types)]
1447 struct RemoteUpdateVectorSvc<T: ClusterService>(pub Arc<T>);
1448 impl<
1449 T: ClusterService,
1450 > tonic::server::UnaryService<super::RemoteUpdateVectorRequest>
1451 for RemoteUpdateVectorSvc<T> {
1452 type Response = super::RemoteUpdateVectorResponse;
1453 type Future = BoxFuture<
1454 tonic::Response<Self::Response>,
1455 tonic::Status,
1456 >;
1457 fn call(
1458 &mut self,
1459 request: tonic::Request<super::RemoteUpdateVectorRequest>,
1460 ) -> Self::Future {
1461 let inner = Arc::clone(&self.0);
1462 let fut = async move {
1463 <T as ClusterService>::remote_update_vector(&inner, request)
1464 .await
1465 };
1466 Box::pin(fut)
1467 }
1468 }
1469 let accept_compression_encodings = self.accept_compression_encodings;
1470 let send_compression_encodings = self.send_compression_encodings;
1471 let max_decoding_message_size = self.max_decoding_message_size;
1472 let max_encoding_message_size = self.max_encoding_message_size;
1473 let inner = self.inner.clone();
1474 let fut = async move {
1475 let method = RemoteUpdateVectorSvc(inner);
1476 let codec = tonic_prost::ProstCodec::default();
1477 let mut grpc = tonic::server::Grpc::new(codec)
1478 .apply_compression_config(
1479 accept_compression_encodings,
1480 send_compression_encodings,
1481 )
1482 .apply_max_message_size_config(
1483 max_decoding_message_size,
1484 max_encoding_message_size,
1485 );
1486 let res = grpc.unary(method, req).await;
1487 Ok(res)
1488 };
1489 Box::pin(fut)
1490 }
1491 "/vectorizer.cluster.ClusterService/RemoteDeleteVector" => {
1492 #[allow(non_camel_case_types)]
1493 struct RemoteDeleteVectorSvc<T: ClusterService>(pub Arc<T>);
1494 impl<
1495 T: ClusterService,
1496 > tonic::server::UnaryService<super::RemoteDeleteVectorRequest>
1497 for RemoteDeleteVectorSvc<T> {
1498 type Response = super::RemoteDeleteVectorResponse;
1499 type Future = BoxFuture<
1500 tonic::Response<Self::Response>,
1501 tonic::Status,
1502 >;
1503 fn call(
1504 &mut self,
1505 request: tonic::Request<super::RemoteDeleteVectorRequest>,
1506 ) -> Self::Future {
1507 let inner = Arc::clone(&self.0);
1508 let fut = async move {
1509 <T as ClusterService>::remote_delete_vector(&inner, request)
1510 .await
1511 };
1512 Box::pin(fut)
1513 }
1514 }
1515 let accept_compression_encodings = self.accept_compression_encodings;
1516 let send_compression_encodings = self.send_compression_encodings;
1517 let max_decoding_message_size = self.max_decoding_message_size;
1518 let max_encoding_message_size = self.max_encoding_message_size;
1519 let inner = self.inner.clone();
1520 let fut = async move {
1521 let method = RemoteDeleteVectorSvc(inner);
1522 let codec = tonic_prost::ProstCodec::default();
1523 let mut grpc = tonic::server::Grpc::new(codec)
1524 .apply_compression_config(
1525 accept_compression_encodings,
1526 send_compression_encodings,
1527 )
1528 .apply_max_message_size_config(
1529 max_decoding_message_size,
1530 max_encoding_message_size,
1531 );
1532 let res = grpc.unary(method, req).await;
1533 Ok(res)
1534 };
1535 Box::pin(fut)
1536 }
1537 "/vectorizer.cluster.ClusterService/RemoteSearchVectors" => {
1538 #[allow(non_camel_case_types)]
1539 struct RemoteSearchVectorsSvc<T: ClusterService>(pub Arc<T>);
1540 impl<
1541 T: ClusterService,
1542 > tonic::server::UnaryService<super::RemoteSearchVectorsRequest>
1543 for RemoteSearchVectorsSvc<T> {
1544 type Response = super::RemoteSearchVectorsResponse;
1545 type Future = BoxFuture<
1546 tonic::Response<Self::Response>,
1547 tonic::Status,
1548 >;
1549 fn call(
1550 &mut self,
1551 request: tonic::Request<super::RemoteSearchVectorsRequest>,
1552 ) -> Self::Future {
1553 let inner = Arc::clone(&self.0);
1554 let fut = async move {
1555 <T as ClusterService>::remote_search_vectors(
1556 &inner,
1557 request,
1558 )
1559 .await
1560 };
1561 Box::pin(fut)
1562 }
1563 }
1564 let accept_compression_encodings = self.accept_compression_encodings;
1565 let send_compression_encodings = self.send_compression_encodings;
1566 let max_decoding_message_size = self.max_decoding_message_size;
1567 let max_encoding_message_size = self.max_encoding_message_size;
1568 let inner = self.inner.clone();
1569 let fut = async move {
1570 let method = RemoteSearchVectorsSvc(inner);
1571 let codec = tonic_prost::ProstCodec::default();
1572 let mut grpc = tonic::server::Grpc::new(codec)
1573 .apply_compression_config(
1574 accept_compression_encodings,
1575 send_compression_encodings,
1576 )
1577 .apply_max_message_size_config(
1578 max_decoding_message_size,
1579 max_encoding_message_size,
1580 );
1581 let res = grpc.unary(method, req).await;
1582 Ok(res)
1583 };
1584 Box::pin(fut)
1585 }
1586 "/vectorizer.cluster.ClusterService/RemoteHybridSearch" => {
1587 #[allow(non_camel_case_types)]
1588 struct RemoteHybridSearchSvc<T: ClusterService>(pub Arc<T>);
1589 impl<
1590 T: ClusterService,
1591 > tonic::server::UnaryService<super::RemoteHybridSearchRequest>
1592 for RemoteHybridSearchSvc<T> {
1593 type Response = super::RemoteHybridSearchResponse;
1594 type Future = BoxFuture<
1595 tonic::Response<Self::Response>,
1596 tonic::Status,
1597 >;
1598 fn call(
1599 &mut self,
1600 request: tonic::Request<super::RemoteHybridSearchRequest>,
1601 ) -> Self::Future {
1602 let inner = Arc::clone(&self.0);
1603 let fut = async move {
1604 <T as ClusterService>::remote_hybrid_search(&inner, request)
1605 .await
1606 };
1607 Box::pin(fut)
1608 }
1609 }
1610 let accept_compression_encodings = self.accept_compression_encodings;
1611 let send_compression_encodings = self.send_compression_encodings;
1612 let max_decoding_message_size = self.max_decoding_message_size;
1613 let max_encoding_message_size = self.max_encoding_message_size;
1614 let inner = self.inner.clone();
1615 let fut = async move {
1616 let method = RemoteHybridSearchSvc(inner);
1617 let codec = tonic_prost::ProstCodec::default();
1618 let mut grpc = tonic::server::Grpc::new(codec)
1619 .apply_compression_config(
1620 accept_compression_encodings,
1621 send_compression_encodings,
1622 )
1623 .apply_max_message_size_config(
1624 max_decoding_message_size,
1625 max_encoding_message_size,
1626 );
1627 let res = grpc.unary(method, req).await;
1628 Ok(res)
1629 };
1630 Box::pin(fut)
1631 }
1632 "/vectorizer.cluster.ClusterService/RemoteCreateCollection" => {
1633 #[allow(non_camel_case_types)]
1634 struct RemoteCreateCollectionSvc<T: ClusterService>(pub Arc<T>);
1635 impl<
1636 T: ClusterService,
1637 > tonic::server::UnaryService<super::RemoteCreateCollectionRequest>
1638 for RemoteCreateCollectionSvc<T> {
1639 type Response = super::RemoteCreateCollectionResponse;
1640 type Future = BoxFuture<
1641 tonic::Response<Self::Response>,
1642 tonic::Status,
1643 >;
1644 fn call(
1645 &mut self,
1646 request: tonic::Request<super::RemoteCreateCollectionRequest>,
1647 ) -> Self::Future {
1648 let inner = Arc::clone(&self.0);
1649 let fut = async move {
1650 <T as ClusterService>::remote_create_collection(
1651 &inner,
1652 request,
1653 )
1654 .await
1655 };
1656 Box::pin(fut)
1657 }
1658 }
1659 let accept_compression_encodings = self.accept_compression_encodings;
1660 let send_compression_encodings = self.send_compression_encodings;
1661 let max_decoding_message_size = self.max_decoding_message_size;
1662 let max_encoding_message_size = self.max_encoding_message_size;
1663 let inner = self.inner.clone();
1664 let fut = async move {
1665 let method = RemoteCreateCollectionSvc(inner);
1666 let codec = tonic_prost::ProstCodec::default();
1667 let mut grpc = tonic::server::Grpc::new(codec)
1668 .apply_compression_config(
1669 accept_compression_encodings,
1670 send_compression_encodings,
1671 )
1672 .apply_max_message_size_config(
1673 max_decoding_message_size,
1674 max_encoding_message_size,
1675 );
1676 let res = grpc.unary(method, req).await;
1677 Ok(res)
1678 };
1679 Box::pin(fut)
1680 }
1681 "/vectorizer.cluster.ClusterService/RemoteGetCollectionInfo" => {
1682 #[allow(non_camel_case_types)]
1683 struct RemoteGetCollectionInfoSvc<T: ClusterService>(pub Arc<T>);
1684 impl<
1685 T: ClusterService,
1686 > tonic::server::UnaryService<super::RemoteGetCollectionInfoRequest>
1687 for RemoteGetCollectionInfoSvc<T> {
1688 type Response = super::RemoteGetCollectionInfoResponse;
1689 type Future = BoxFuture<
1690 tonic::Response<Self::Response>,
1691 tonic::Status,
1692 >;
1693 fn call(
1694 &mut self,
1695 request: tonic::Request<
1696 super::RemoteGetCollectionInfoRequest,
1697 >,
1698 ) -> Self::Future {
1699 let inner = Arc::clone(&self.0);
1700 let fut = async move {
1701 <T as ClusterService>::remote_get_collection_info(
1702 &inner,
1703 request,
1704 )
1705 .await
1706 };
1707 Box::pin(fut)
1708 }
1709 }
1710 let accept_compression_encodings = self.accept_compression_encodings;
1711 let send_compression_encodings = self.send_compression_encodings;
1712 let max_decoding_message_size = self.max_decoding_message_size;
1713 let max_encoding_message_size = self.max_encoding_message_size;
1714 let inner = self.inner.clone();
1715 let fut = async move {
1716 let method = RemoteGetCollectionInfoSvc(inner);
1717 let codec = tonic_prost::ProstCodec::default();
1718 let mut grpc = tonic::server::Grpc::new(codec)
1719 .apply_compression_config(
1720 accept_compression_encodings,
1721 send_compression_encodings,
1722 )
1723 .apply_max_message_size_config(
1724 max_decoding_message_size,
1725 max_encoding_message_size,
1726 );
1727 let res = grpc.unary(method, req).await;
1728 Ok(res)
1729 };
1730 Box::pin(fut)
1731 }
1732 "/vectorizer.cluster.ClusterService/RemoteDeleteCollection" => {
1733 #[allow(non_camel_case_types)]
1734 struct RemoteDeleteCollectionSvc<T: ClusterService>(pub Arc<T>);
1735 impl<
1736 T: ClusterService,
1737 > tonic::server::UnaryService<super::RemoteDeleteCollectionRequest>
1738 for RemoteDeleteCollectionSvc<T> {
1739 type Response = super::RemoteDeleteCollectionResponse;
1740 type Future = BoxFuture<
1741 tonic::Response<Self::Response>,
1742 tonic::Status,
1743 >;
1744 fn call(
1745 &mut self,
1746 request: tonic::Request<super::RemoteDeleteCollectionRequest>,
1747 ) -> Self::Future {
1748 let inner = Arc::clone(&self.0);
1749 let fut = async move {
1750 <T as ClusterService>::remote_delete_collection(
1751 &inner,
1752 request,
1753 )
1754 .await
1755 };
1756 Box::pin(fut)
1757 }
1758 }
1759 let accept_compression_encodings = self.accept_compression_encodings;
1760 let send_compression_encodings = self.send_compression_encodings;
1761 let max_decoding_message_size = self.max_decoding_message_size;
1762 let max_encoding_message_size = self.max_encoding_message_size;
1763 let inner = self.inner.clone();
1764 let fut = async move {
1765 let method = RemoteDeleteCollectionSvc(inner);
1766 let codec = tonic_prost::ProstCodec::default();
1767 let mut grpc = tonic::server::Grpc::new(codec)
1768 .apply_compression_config(
1769 accept_compression_encodings,
1770 send_compression_encodings,
1771 )
1772 .apply_max_message_size_config(
1773 max_decoding_message_size,
1774 max_encoding_message_size,
1775 );
1776 let res = grpc.unary(method, req).await;
1777 Ok(res)
1778 };
1779 Box::pin(fut)
1780 }
1781 "/vectorizer.cluster.ClusterService/HealthCheck" => {
1782 #[allow(non_camel_case_types)]
1783 struct HealthCheckSvc<T: ClusterService>(pub Arc<T>);
1784 impl<
1785 T: ClusterService,
1786 > tonic::server::UnaryService<super::HealthCheckRequest>
1787 for HealthCheckSvc<T> {
1788 type Response = super::HealthCheckResponse;
1789 type Future = BoxFuture<
1790 tonic::Response<Self::Response>,
1791 tonic::Status,
1792 >;
1793 fn call(
1794 &mut self,
1795 request: tonic::Request<super::HealthCheckRequest>,
1796 ) -> Self::Future {
1797 let inner = Arc::clone(&self.0);
1798 let fut = async move {
1799 <T as ClusterService>::health_check(&inner, request).await
1800 };
1801 Box::pin(fut)
1802 }
1803 }
1804 let accept_compression_encodings = self.accept_compression_encodings;
1805 let send_compression_encodings = self.send_compression_encodings;
1806 let max_decoding_message_size = self.max_decoding_message_size;
1807 let max_encoding_message_size = self.max_encoding_message_size;
1808 let inner = self.inner.clone();
1809 let fut = async move {
1810 let method = HealthCheckSvc(inner);
1811 let codec = tonic_prost::ProstCodec::default();
1812 let mut grpc = tonic::server::Grpc::new(codec)
1813 .apply_compression_config(
1814 accept_compression_encodings,
1815 send_compression_encodings,
1816 )
1817 .apply_max_message_size_config(
1818 max_decoding_message_size,
1819 max_encoding_message_size,
1820 );
1821 let res = grpc.unary(method, req).await;
1822 Ok(res)
1823 };
1824 Box::pin(fut)
1825 }
1826 "/vectorizer.cluster.ClusterService/CheckQuota" => {
1827 #[allow(non_camel_case_types)]
1828 struct CheckQuotaSvc<T: ClusterService>(pub Arc<T>);
1829 impl<
1830 T: ClusterService,
1831 > tonic::server::UnaryService<super::CheckQuotaRequest>
1832 for CheckQuotaSvc<T> {
1833 type Response = super::CheckQuotaResponse;
1834 type Future = BoxFuture<
1835 tonic::Response<Self::Response>,
1836 tonic::Status,
1837 >;
1838 fn call(
1839 &mut self,
1840 request: tonic::Request<super::CheckQuotaRequest>,
1841 ) -> Self::Future {
1842 let inner = Arc::clone(&self.0);
1843 let fut = async move {
1844 <T as ClusterService>::check_quota(&inner, request).await
1845 };
1846 Box::pin(fut)
1847 }
1848 }
1849 let accept_compression_encodings = self.accept_compression_encodings;
1850 let send_compression_encodings = self.send_compression_encodings;
1851 let max_decoding_message_size = self.max_decoding_message_size;
1852 let max_encoding_message_size = self.max_encoding_message_size;
1853 let inner = self.inner.clone();
1854 let fut = async move {
1855 let method = CheckQuotaSvc(inner);
1856 let codec = tonic_prost::ProstCodec::default();
1857 let mut grpc = tonic::server::Grpc::new(codec)
1858 .apply_compression_config(
1859 accept_compression_encodings,
1860 send_compression_encodings,
1861 )
1862 .apply_max_message_size_config(
1863 max_decoding_message_size,
1864 max_encoding_message_size,
1865 );
1866 let res = grpc.unary(method, req).await;
1867 Ok(res)
1868 };
1869 Box::pin(fut)
1870 }
1871 "/vectorizer.cluster.ClusterService/GetShardVectors" => {
1872 #[allow(non_camel_case_types)]
1873 struct GetShardVectorsSvc<T: ClusterService>(pub Arc<T>);
1874 impl<
1875 T: ClusterService,
1876 > tonic::server::UnaryService<super::GetShardVectorsRequest>
1877 for GetShardVectorsSvc<T> {
1878 type Response = super::GetShardVectorsResponse;
1879 type Future = BoxFuture<
1880 tonic::Response<Self::Response>,
1881 tonic::Status,
1882 >;
1883 fn call(
1884 &mut self,
1885 request: tonic::Request<super::GetShardVectorsRequest>,
1886 ) -> Self::Future {
1887 let inner = Arc::clone(&self.0);
1888 let fut = async move {
1889 <T as ClusterService>::get_shard_vectors(&inner, request)
1890 .await
1891 };
1892 Box::pin(fut)
1893 }
1894 }
1895 let accept_compression_encodings = self.accept_compression_encodings;
1896 let send_compression_encodings = self.send_compression_encodings;
1897 let max_decoding_message_size = self.max_decoding_message_size;
1898 let max_encoding_message_size = self.max_encoding_message_size;
1899 let inner = self.inner.clone();
1900 let fut = async move {
1901 let method = GetShardVectorsSvc(inner);
1902 let codec = tonic_prost::ProstCodec::default();
1903 let mut grpc = tonic::server::Grpc::new(codec)
1904 .apply_compression_config(
1905 accept_compression_encodings,
1906 send_compression_encodings,
1907 )
1908 .apply_max_message_size_config(
1909 max_decoding_message_size,
1910 max_encoding_message_size,
1911 );
1912 let res = grpc.unary(method, req).await;
1913 Ok(res)
1914 };
1915 Box::pin(fut)
1916 }
1917 "/vectorizer.cluster.ClusterService/RaftVote" => {
1918 #[allow(non_camel_case_types)]
1919 struct RaftVoteSvc<T: ClusterService>(pub Arc<T>);
1920 impl<
1921 T: ClusterService,
1922 > tonic::server::UnaryService<super::RaftVoteRequest>
1923 for RaftVoteSvc<T> {
1924 type Response = super::RaftVoteResponse;
1925 type Future = BoxFuture<
1926 tonic::Response<Self::Response>,
1927 tonic::Status,
1928 >;
1929 fn call(
1930 &mut self,
1931 request: tonic::Request<super::RaftVoteRequest>,
1932 ) -> Self::Future {
1933 let inner = Arc::clone(&self.0);
1934 let fut = async move {
1935 <T as ClusterService>::raft_vote(&inner, request).await
1936 };
1937 Box::pin(fut)
1938 }
1939 }
1940 let accept_compression_encodings = self.accept_compression_encodings;
1941 let send_compression_encodings = self.send_compression_encodings;
1942 let max_decoding_message_size = self.max_decoding_message_size;
1943 let max_encoding_message_size = self.max_encoding_message_size;
1944 let inner = self.inner.clone();
1945 let fut = async move {
1946 let method = RaftVoteSvc(inner);
1947 let codec = tonic_prost::ProstCodec::default();
1948 let mut grpc = tonic::server::Grpc::new(codec)
1949 .apply_compression_config(
1950 accept_compression_encodings,
1951 send_compression_encodings,
1952 )
1953 .apply_max_message_size_config(
1954 max_decoding_message_size,
1955 max_encoding_message_size,
1956 );
1957 let res = grpc.unary(method, req).await;
1958 Ok(res)
1959 };
1960 Box::pin(fut)
1961 }
1962 "/vectorizer.cluster.ClusterService/RaftAppendEntries" => {
1963 #[allow(non_camel_case_types)]
1964 struct RaftAppendEntriesSvc<T: ClusterService>(pub Arc<T>);
1965 impl<
1966 T: ClusterService,
1967 > tonic::server::UnaryService<super::RaftAppendEntriesRequest>
1968 for RaftAppendEntriesSvc<T> {
1969 type Response = super::RaftAppendEntriesResponse;
1970 type Future = BoxFuture<
1971 tonic::Response<Self::Response>,
1972 tonic::Status,
1973 >;
1974 fn call(
1975 &mut self,
1976 request: tonic::Request<super::RaftAppendEntriesRequest>,
1977 ) -> Self::Future {
1978 let inner = Arc::clone(&self.0);
1979 let fut = async move {
1980 <T as ClusterService>::raft_append_entries(&inner, request)
1981 .await
1982 };
1983 Box::pin(fut)
1984 }
1985 }
1986 let accept_compression_encodings = self.accept_compression_encodings;
1987 let send_compression_encodings = self.send_compression_encodings;
1988 let max_decoding_message_size = self.max_decoding_message_size;
1989 let max_encoding_message_size = self.max_encoding_message_size;
1990 let inner = self.inner.clone();
1991 let fut = async move {
1992 let method = RaftAppendEntriesSvc(inner);
1993 let codec = tonic_prost::ProstCodec::default();
1994 let mut grpc = tonic::server::Grpc::new(codec)
1995 .apply_compression_config(
1996 accept_compression_encodings,
1997 send_compression_encodings,
1998 )
1999 .apply_max_message_size_config(
2000 max_decoding_message_size,
2001 max_encoding_message_size,
2002 );
2003 let res = grpc.unary(method, req).await;
2004 Ok(res)
2005 };
2006 Box::pin(fut)
2007 }
2008 "/vectorizer.cluster.ClusterService/RaftSnapshot" => {
2009 #[allow(non_camel_case_types)]
2010 struct RaftSnapshotSvc<T: ClusterService>(pub Arc<T>);
2011 impl<
2012 T: ClusterService,
2013 > tonic::server::UnaryService<super::RaftSnapshotRequest>
2014 for RaftSnapshotSvc<T> {
2015 type Response = super::RaftSnapshotResponse;
2016 type Future = BoxFuture<
2017 tonic::Response<Self::Response>,
2018 tonic::Status,
2019 >;
2020 fn call(
2021 &mut self,
2022 request: tonic::Request<super::RaftSnapshotRequest>,
2023 ) -> Self::Future {
2024 let inner = Arc::clone(&self.0);
2025 let fut = async move {
2026 <T as ClusterService>::raft_snapshot(&inner, request).await
2027 };
2028 Box::pin(fut)
2029 }
2030 }
2031 let accept_compression_encodings = self.accept_compression_encodings;
2032 let send_compression_encodings = self.send_compression_encodings;
2033 let max_decoding_message_size = self.max_decoding_message_size;
2034 let max_encoding_message_size = self.max_encoding_message_size;
2035 let inner = self.inner.clone();
2036 let fut = async move {
2037 let method = RaftSnapshotSvc(inner);
2038 let codec = tonic_prost::ProstCodec::default();
2039 let mut grpc = tonic::server::Grpc::new(codec)
2040 .apply_compression_config(
2041 accept_compression_encodings,
2042 send_compression_encodings,
2043 )
2044 .apply_max_message_size_config(
2045 max_decoding_message_size,
2046 max_encoding_message_size,
2047 );
2048 let res = grpc.unary(method, req).await;
2049 Ok(res)
2050 };
2051 Box::pin(fut)
2052 }
2053 _ => {
2054 Box::pin(async move {
2055 let mut response = http::Response::new(
2056 tonic::body::Body::default(),
2057 );
2058 let headers = response.headers_mut();
2059 headers
2060 .insert(
2061 tonic::Status::GRPC_STATUS,
2062 (tonic::Code::Unimplemented as i32).into(),
2063 );
2064 headers
2065 .insert(
2066 http::header::CONTENT_TYPE,
2067 tonic::metadata::GRPC_CONTENT_TYPE,
2068 );
2069 Ok(response)
2070 })
2071 }
2072 }
2073 }
2074 }
2075 impl<T> Clone for ClusterServiceServer<T> {
2076 fn clone(&self) -> Self {
2077 let inner = self.inner.clone();
2078 Self {
2079 inner,
2080 accept_compression_encodings: self.accept_compression_encodings,
2081 send_compression_encodings: self.send_compression_encodings,
2082 max_decoding_message_size: self.max_decoding_message_size,
2083 max_encoding_message_size: self.max_encoding_message_size,
2084 }
2085 }
2086 }
2087 pub const SERVICE_NAME: &str = "vectorizer.cluster.ClusterService";
2089 impl<T> tonic::server::NamedService for ClusterServiceServer<T> {
2090 const NAME: &'static str = SERVICE_NAME;
2091 }
2092}