#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TenantContext {
#[prost(string, tag = "1")]
pub tenant_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub trace_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetClusterStateRequest {
#[prost(string, tag = "1")]
pub node_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClusterStateResponse {
#[prost(message, repeated, tag = "1")]
pub nodes: ::prost::alloc::vec::Vec<ClusterNode>,
#[prost(map = "uint32, string", tag = "2")]
pub shard_to_node: ::std::collections::HashMap<u32, ::prost::alloc::string::String>,
#[prost(uint64, tag = "3")]
pub current_epoch: u64,
#[prost(map = "uint32, uint64", tag = "4")]
pub shard_epochs: ::std::collections::HashMap<u32, u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClusterStateRequest {
#[prost(message, optional, tag = "1")]
pub node: ::core::option::Option<ClusterNode>,
#[prost(message, repeated, tag = "2")]
pub shard_assignments: ::prost::alloc::vec::Vec<ShardAssignment>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateClusterStateResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterNode {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub grpc_port: u32,
#[prost(enumeration = "NodeStatus", tag = "4")]
pub status: i32,
#[prost(uint32, repeated, tag = "5")]
pub shards: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, tag = "6")]
pub metadata: ::core::option::Option<NodeMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeMetadata {
#[prost(string, optional, tag = "1")]
pub version: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub capabilities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint64, tag = "3")]
pub vector_count: u64,
#[prost(uint64, tag = "4")]
pub memory_usage: u64,
#[prost(float, tag = "5")]
pub cpu_usage: f32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardAssignment {
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(string, tag = "2")]
pub node_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub config_epoch: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteInsertVectorRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vector_id: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "3")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, optional, tag = "4")]
pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteInsertVectorResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteUpdateVectorRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vector_id: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "3")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, optional, tag = "4")]
pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteUpdateVectorResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteDeleteVectorRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vector_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteDeleteVectorResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteSearchVectorsRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "2")]
pub query_vector: ::prost::alloc::vec::Vec<f32>,
#[prost(uint32, tag = "3")]
pub limit: u32,
#[prost(float, optional, tag = "4")]
pub threshold: ::core::option::Option<f32>,
#[prost(uint32, repeated, tag = "5")]
pub shard_ids: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, tag = "6")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteSearchVectorsResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<SearchResult>,
#[prost(bool, tag = "2")]
pub success: bool,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResult {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(float, tag = "2")]
pub score: f32,
#[prost(float, repeated, tag = "3")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, optional, tag = "4")]
pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SparseVector {
#[prost(uint32, repeated, tag = "1")]
pub indices: ::prost::alloc::vec::Vec<u32>,
#[prost(float, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<f32>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HybridSearchConfig {
#[prost(uint32, tag = "1")]
pub dense_k: u32,
#[prost(uint32, tag = "2")]
pub sparse_k: u32,
#[prost(uint32, tag = "3")]
pub final_k: u32,
#[prost(double, tag = "4")]
pub alpha: f64,
#[prost(enumeration = "HybridScoringAlgorithm", tag = "5")]
pub algorithm: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteHybridSearchRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "2")]
pub dense_query: ::prost::alloc::vec::Vec<f32>,
#[prost(message, optional, tag = "3")]
pub sparse_query: ::core::option::Option<SparseVector>,
#[prost(message, optional, tag = "4")]
pub config: ::core::option::Option<HybridSearchConfig>,
#[prost(uint32, repeated, tag = "5")]
pub shard_ids: ::prost::alloc::vec::Vec<u32>,
#[prost(message, optional, tag = "6")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HybridSearchResult {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(float, tag = "2")]
pub hybrid_score: f32,
#[prost(float, optional, tag = "3")]
pub dense_score: ::core::option::Option<f32>,
#[prost(float, optional, tag = "4")]
pub sparse_score: ::core::option::Option<f32>,
#[prost(float, repeated, tag = "5")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, optional, tag = "6")]
pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteHybridSearchResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<HybridSearchResult>,
#[prost(bool, tag = "2")]
pub success: bool,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteCreateCollectionRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<CollectionConfig>,
#[prost(message, optional, tag = "3")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteCreateCollectionResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteGetCollectionInfoRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteGetCollectionInfoResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<CollectionInfo>,
#[prost(bool, tag = "2")]
pub success: bool,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteDeleteCollectionRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteDeleteCollectionResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthCheckRequest {
#[prost(string, tag = "1")]
pub node_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
#[prost(bool, tag = "1")]
pub healthy: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub metadata: ::core::option::Option<NodeMetadata>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CheckQuotaRequest {
#[prost(message, optional, tag = "1")]
pub tenant: ::core::option::Option<TenantContext>,
#[prost(enumeration = "QuotaType", tag = "2")]
pub quota_type: i32,
#[prost(uint64, tag = "3")]
pub requested_amount: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CheckQuotaResponse {
#[prost(bool, tag = "1")]
pub allowed: bool,
#[prost(uint64, tag = "2")]
pub current_usage: u64,
#[prost(uint64, tag = "3")]
pub limit: u64,
#[prost(uint64, tag = "4")]
pub remaining: u64,
#[prost(string, tag = "5")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetShardVectorsRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(uint32, tag = "3")]
pub offset: u32,
#[prost(uint32, tag = "4")]
pub limit: u32,
#[prost(message, optional, tag = "5")]
pub tenant: ::core::option::Option<TenantContext>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardVectorsResponse {
#[prost(message, repeated, tag = "1")]
pub vectors: ::prost::alloc::vec::Vec<VectorData>,
#[prost(uint32, tag = "2")]
pub total_count: u32,
#[prost(bool, tag = "3")]
pub has_more: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorData {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(float, repeated, tag = "2")]
pub vector: ::prost::alloc::vec::Vec<f32>,
#[prost(string, optional, tag = "3")]
pub payload_json: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionConfig {
#[prost(uint32, tag = "1")]
pub dimension: u32,
#[prost(string, tag = "2")]
pub metric: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub vector_count: u64,
#[prost(uint64, tag = "3")]
pub document_count: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftVoteRequest {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftVoteResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftAppendEntriesRequest {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftAppendEntriesResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftSnapshotRequest {
#[prost(bytes = "vec", tag = "1")]
pub vote_data: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub snapshot_meta: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub snapshot_data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftSnapshotResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NodeStatus {
Active = 0,
Joining = 1,
Leaving = 2,
Unavailable = 3,
}
impl NodeStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Active => "ACTIVE",
Self::Joining => "JOINING",
Self::Leaving => "LEAVING",
Self::Unavailable => "UNAVAILABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACTIVE" => Some(Self::Active),
"JOINING" => Some(Self::Joining),
"LEAVING" => Some(Self::Leaving),
"UNAVAILABLE" => Some(Self::Unavailable),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HybridScoringAlgorithm {
HybridScoringRrf = 0,
HybridScoringWeighted = 1,
HybridScoringAlphaBlend = 2,
}
impl HybridScoringAlgorithm {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::HybridScoringRrf => "HYBRID_SCORING_RRF",
Self::HybridScoringWeighted => "HYBRID_SCORING_WEIGHTED",
Self::HybridScoringAlphaBlend => "HYBRID_SCORING_ALPHA_BLEND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HYBRID_SCORING_RRF" => Some(Self::HybridScoringRrf),
"HYBRID_SCORING_WEIGHTED" => Some(Self::HybridScoringWeighted),
"HYBRID_SCORING_ALPHA_BLEND" => Some(Self::HybridScoringAlphaBlend),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QuotaType {
QuotaCollections = 0,
QuotaVectors = 1,
QuotaStorage = 2,
}
impl QuotaType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::QuotaCollections => "QUOTA_COLLECTIONS",
Self::QuotaVectors => "QUOTA_VECTORS",
Self::QuotaStorage => "QUOTA_STORAGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"QUOTA_COLLECTIONS" => Some(Self::QuotaCollections),
"QUOTA_VECTORS" => Some(Self::QuotaVectors),
"QUOTA_STORAGE" => Some(Self::QuotaStorage),
_ => None,
}
}
}
pub mod cluster_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ClusterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ClusterServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ClusterServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> ClusterServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ClusterServiceClient::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
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_cluster_state(
&mut self,
request: impl tonic::IntoRequest<super::GetClusterStateRequest>,
) -> std::result::Result<
tonic::Response<super::GetClusterStateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/GetClusterState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"GetClusterState",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_cluster_state(
&mut self,
request: impl tonic::IntoRequest<super::UpdateClusterStateRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateClusterStateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/UpdateClusterState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"UpdateClusterState",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_insert_vector(
&mut self,
request: impl tonic::IntoRequest<super::RemoteInsertVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteInsertVectorResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteInsertVector",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteInsertVector",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_update_vector(
&mut self,
request: impl tonic::IntoRequest<super::RemoteUpdateVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteUpdateVectorResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteUpdateVector",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteUpdateVector",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_delete_vector(
&mut self,
request: impl tonic::IntoRequest<super::RemoteDeleteVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteDeleteVectorResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteDeleteVector",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteDeleteVector",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_search_vectors(
&mut self,
request: impl tonic::IntoRequest<super::RemoteSearchVectorsRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteSearchVectorsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteSearchVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteSearchVectors",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_hybrid_search(
&mut self,
request: impl tonic::IntoRequest<super::RemoteHybridSearchRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteHybridSearchResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteHybridSearch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteHybridSearch",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_create_collection(
&mut self,
request: impl tonic::IntoRequest<super::RemoteCreateCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteCreateCollectionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteCreateCollection",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteCreateCollection",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_get_collection_info(
&mut self,
request: impl tonic::IntoRequest<super::RemoteGetCollectionInfoRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteGetCollectionInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteGetCollectionInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteGetCollectionInfo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn remote_delete_collection(
&mut self,
request: impl tonic::IntoRequest<super::RemoteDeleteCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteDeleteCollectionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RemoteDeleteCollection",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RemoteDeleteCollection",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn health_check(
&mut self,
request: impl tonic::IntoRequest<super::HealthCheckRequest>,
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/HealthCheck",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("vectorizer.cluster.ClusterService", "HealthCheck"),
);
self.inner.unary(req, path, codec).await
}
pub async fn check_quota(
&mut self,
request: impl tonic::IntoRequest<super::CheckQuotaRequest>,
) -> std::result::Result<
tonic::Response<super::CheckQuotaResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/CheckQuota",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("vectorizer.cluster.ClusterService", "CheckQuota"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_shard_vectors(
&mut self,
request: impl tonic::IntoRequest<super::GetShardVectorsRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardVectorsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/GetShardVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"GetShardVectors",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn raft_vote(
&mut self,
request: impl tonic::IntoRequest<super::RaftVoteRequest>,
) -> std::result::Result<
tonic::Response<super::RaftVoteResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RaftVote",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("vectorizer.cluster.ClusterService", "RaftVote"),
);
self.inner.unary(req, path, codec).await
}
pub async fn raft_append_entries(
&mut self,
request: impl tonic::IntoRequest<super::RaftAppendEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::RaftAppendEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RaftAppendEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"vectorizer.cluster.ClusterService",
"RaftAppendEntries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn raft_snapshot(
&mut self,
request: impl tonic::IntoRequest<super::RaftSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::RaftSnapshotResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/vectorizer.cluster.ClusterService/RaftSnapshot",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("vectorizer.cluster.ClusterService", "RaftSnapshot"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod cluster_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ClusterService: std::marker::Send + std::marker::Sync + 'static {
async fn get_cluster_state(
&self,
request: tonic::Request<super::GetClusterStateRequest>,
) -> std::result::Result<
tonic::Response<super::GetClusterStateResponse>,
tonic::Status,
>;
async fn update_cluster_state(
&self,
request: tonic::Request<super::UpdateClusterStateRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateClusterStateResponse>,
tonic::Status,
>;
async fn remote_insert_vector(
&self,
request: tonic::Request<super::RemoteInsertVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteInsertVectorResponse>,
tonic::Status,
>;
async fn remote_update_vector(
&self,
request: tonic::Request<super::RemoteUpdateVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteUpdateVectorResponse>,
tonic::Status,
>;
async fn remote_delete_vector(
&self,
request: tonic::Request<super::RemoteDeleteVectorRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteDeleteVectorResponse>,
tonic::Status,
>;
async fn remote_search_vectors(
&self,
request: tonic::Request<super::RemoteSearchVectorsRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteSearchVectorsResponse>,
tonic::Status,
>;
async fn remote_hybrid_search(
&self,
request: tonic::Request<super::RemoteHybridSearchRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteHybridSearchResponse>,
tonic::Status,
>;
async fn remote_create_collection(
&self,
request: tonic::Request<super::RemoteCreateCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteCreateCollectionResponse>,
tonic::Status,
>;
async fn remote_get_collection_info(
&self,
request: tonic::Request<super::RemoteGetCollectionInfoRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteGetCollectionInfoResponse>,
tonic::Status,
>;
async fn remote_delete_collection(
&self,
request: tonic::Request<super::RemoteDeleteCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::RemoteDeleteCollectionResponse>,
tonic::Status,
>;
async fn health_check(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
>;
async fn check_quota(
&self,
request: tonic::Request<super::CheckQuotaRequest>,
) -> std::result::Result<
tonic::Response<super::CheckQuotaResponse>,
tonic::Status,
>;
async fn get_shard_vectors(
&self,
request: tonic::Request<super::GetShardVectorsRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardVectorsResponse>,
tonic::Status,
>;
async fn raft_vote(
&self,
request: tonic::Request<super::RaftVoteRequest>,
) -> std::result::Result<
tonic::Response<super::RaftVoteResponse>,
tonic::Status,
>;
async fn raft_append_entries(
&self,
request: tonic::Request<super::RaftAppendEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::RaftAppendEntriesResponse>,
tonic::Status,
>;
async fn raft_snapshot(
&self,
request: tonic::Request<super::RaftSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::RaftSnapshotResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ClusterServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ClusterServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ClusterServiceServer<T>
where
T: ClusterService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/vectorizer.cluster.ClusterService/GetClusterState" => {
#[allow(non_camel_case_types)]
struct GetClusterStateSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::GetClusterStateRequest>
for GetClusterStateSvc<T> {
type Response = super::GetClusterStateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetClusterStateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::get_cluster_state(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetClusterStateSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/UpdateClusterState" => {
#[allow(non_camel_case_types)]
struct UpdateClusterStateSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::UpdateClusterStateRequest>
for UpdateClusterStateSvc<T> {
type Response = super::UpdateClusterStateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateClusterStateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::update_cluster_state(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdateClusterStateSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteInsertVector" => {
#[allow(non_camel_case_types)]
struct RemoteInsertVectorSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteInsertVectorRequest>
for RemoteInsertVectorSvc<T> {
type Response = super::RemoteInsertVectorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteInsertVectorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_insert_vector(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteInsertVectorSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteUpdateVector" => {
#[allow(non_camel_case_types)]
struct RemoteUpdateVectorSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteUpdateVectorRequest>
for RemoteUpdateVectorSvc<T> {
type Response = super::RemoteUpdateVectorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteUpdateVectorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_update_vector(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteUpdateVectorSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteDeleteVector" => {
#[allow(non_camel_case_types)]
struct RemoteDeleteVectorSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteDeleteVectorRequest>
for RemoteDeleteVectorSvc<T> {
type Response = super::RemoteDeleteVectorResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteDeleteVectorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_delete_vector(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteDeleteVectorSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteSearchVectors" => {
#[allow(non_camel_case_types)]
struct RemoteSearchVectorsSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteSearchVectorsRequest>
for RemoteSearchVectorsSvc<T> {
type Response = super::RemoteSearchVectorsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteSearchVectorsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_search_vectors(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteSearchVectorsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteHybridSearch" => {
#[allow(non_camel_case_types)]
struct RemoteHybridSearchSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteHybridSearchRequest>
for RemoteHybridSearchSvc<T> {
type Response = super::RemoteHybridSearchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteHybridSearchRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_hybrid_search(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteHybridSearchSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteCreateCollection" => {
#[allow(non_camel_case_types)]
struct RemoteCreateCollectionSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteCreateCollectionRequest>
for RemoteCreateCollectionSvc<T> {
type Response = super::RemoteCreateCollectionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteCreateCollectionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_create_collection(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteCreateCollectionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteGetCollectionInfo" => {
#[allow(non_camel_case_types)]
struct RemoteGetCollectionInfoSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteGetCollectionInfoRequest>
for RemoteGetCollectionInfoSvc<T> {
type Response = super::RemoteGetCollectionInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::RemoteGetCollectionInfoRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_get_collection_info(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteGetCollectionInfoSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RemoteDeleteCollection" => {
#[allow(non_camel_case_types)]
struct RemoteDeleteCollectionSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RemoteDeleteCollectionRequest>
for RemoteDeleteCollectionSvc<T> {
type Response = super::RemoteDeleteCollectionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RemoteDeleteCollectionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::remote_delete_collection(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RemoteDeleteCollectionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/HealthCheck" => {
#[allow(non_camel_case_types)]
struct HealthCheckSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::HealthCheckRequest>
for HealthCheckSvc<T> {
type Response = super::HealthCheckResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HealthCheckRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::health_check(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = HealthCheckSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/CheckQuota" => {
#[allow(non_camel_case_types)]
struct CheckQuotaSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::CheckQuotaRequest>
for CheckQuotaSvc<T> {
type Response = super::CheckQuotaResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CheckQuotaRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::check_quota(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CheckQuotaSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/GetShardVectors" => {
#[allow(non_camel_case_types)]
struct GetShardVectorsSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::GetShardVectorsRequest>
for GetShardVectorsSvc<T> {
type Response = super::GetShardVectorsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetShardVectorsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::get_shard_vectors(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetShardVectorsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RaftVote" => {
#[allow(non_camel_case_types)]
struct RaftVoteSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RaftVoteRequest>
for RaftVoteSvc<T> {
type Response = super::RaftVoteResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RaftVoteRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::raft_vote(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RaftVoteSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RaftAppendEntries" => {
#[allow(non_camel_case_types)]
struct RaftAppendEntriesSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RaftAppendEntriesRequest>
for RaftAppendEntriesSvc<T> {
type Response = super::RaftAppendEntriesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RaftAppendEntriesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::raft_append_entries(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RaftAppendEntriesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/vectorizer.cluster.ClusterService/RaftSnapshot" => {
#[allow(non_camel_case_types)]
struct RaftSnapshotSvc<T: ClusterService>(pub Arc<T>);
impl<
T: ClusterService,
> tonic::server::UnaryService<super::RaftSnapshotRequest>
for RaftSnapshotSvc<T> {
type Response = super::RaftSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RaftSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ClusterService>::raft_snapshot(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RaftSnapshotSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ClusterServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "vectorizer.cluster.ClusterService";
impl<T> tonic::server::NamedService for ClusterServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}