Files
qdrant/lib/api/src/grpc/qdrant.rs
T
Tim Visée 3885c01492 Add time to gRPC responses (#9733)
* Add missing time response in some gRPC APIs, make consistent with REST

* Don't use destructor
2026-08-04 11:16:59 +02:00

17527 lines
731 KiB
Rust

// This file is @generated by prost-build.
/// `Struct` represents a structured data value, consisting of fields
/// which map to dynamically typed values. In some languages, `Struct`
/// might be supported by a native representation. For example, in
/// scripting languages like JS a struct is represented as an
/// object. The details of that representation are described together
/// with the proto support for the language.
///
/// The JSON representation for `Struct` is a JSON object.
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Struct {
/// Unordered map of dynamically typed values.
#[prost(map = "string, message", tag = "1")]
pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
/// `Value` represents a dynamically typed value which can be either
/// null, a number, a string, a boolean, a recursive struct value, or a
/// list of values. A producer of value is expected to set one of those
/// variants, absence of any variant indicates an error.
///
/// The JSON representation for `Value` is a JSON value.
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
/// The kind of value.
#[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6, 7")]
pub kind: ::core::option::Option<value::Kind>,
}
/// Nested message and enum types in `Value`.
pub mod value {
/// The kind of value.
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
/// Represents a null value.
#[prost(enumeration = "super::NullValue", tag = "1")]
NullValue(i32),
/// Represents a double value.
#[prost(double, tag = "2")]
DoubleValue(f64),
/// Represents an integer value
#[prost(int64, tag = "3")]
IntegerValue(i64),
/// Represents a string value.
#[prost(string, tag = "4")]
StringValue(::prost::alloc::string::String),
/// Represents a boolean value.
#[prost(bool, tag = "5")]
BoolValue(bool),
/// Represents a structured value.
#[prost(message, tag = "6")]
StructValue(super::Struct),
/// Represents a repeated `Value`.
#[prost(message, tag = "7")]
ListValue(super::ListValue),
}
}
/// `ListValue` is a wrapper around a repeated field of values.
///
/// The JSON representation for `ListValue` is a JSON array.
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
/// Repeated field of dynamically typed values.
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<Value>,
}
/// `NullValue` is a singleton enumeration to represent the null value for the
/// `Value` type union.
///
/// The JSON representation for `NullValue` is JSON `null`.
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NullValue {
/// Null value.
NullValue = 0,
}
impl NullValue {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NullValue => "NULL_VALUE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NULL_VALUE" => Some(Self::NullValue),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PointId {
#[prost(oneof = "point_id::PointIdOptions", tags = "1, 2")]
pub point_id_options: ::core::option::Option<point_id::PointIdOptions>,
}
/// Nested message and enum types in `PointId`.
pub mod point_id {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PointIdOptions {
/// Numerical ID of the point
#[prost(uint64, tag = "1")]
Num(u64),
/// UUID
#[prost(string, tag = "2")]
Uuid(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GeoPoint {
#[prost(double, tag = "1")]
pub lon: f64,
#[prost(double, tag = "2")]
pub lat: f64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Filter {
/// At least one of those conditions should match
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub should: ::prost::alloc::vec::Vec<Condition>,
/// All conditions must match
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub must: ::prost::alloc::vec::Vec<Condition>,
/// All conditions must NOT match
#[prost(message, repeated, tag = "3")]
#[validate(nested)]
pub must_not: ::prost::alloc::vec::Vec<Condition>,
/// At least minimum amount of given conditions should match
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub min_should: ::core::option::Option<MinShould>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MinShould {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
#[prost(uint64, tag = "2")]
#[validate(range(min = 1, message = "min_count must be greater than 0"))]
pub min_count: u64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Condition {
#[prost(oneof = "condition::ConditionOneOf", tags = "1, 2, 3, 4, 5, 6, 7")]
#[validate(nested)]
pub condition_one_of: ::core::option::Option<condition::ConditionOneOf>,
}
/// Nested message and enum types in `Condition`.
pub mod condition {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ConditionOneOf {
#[prost(message, tag = "1")]
Field(super::FieldCondition),
#[prost(message, tag = "2")]
IsEmpty(super::IsEmptyCondition),
#[prost(message, tag = "3")]
HasId(super::HasIdCondition),
#[prost(message, tag = "4")]
Filter(super::Filter),
#[prost(message, tag = "5")]
IsNull(super::IsNullCondition),
#[prost(message, tag = "6")]
Nested(super::NestedCondition),
#[prost(message, tag = "7")]
HasVector(super::HasVectorCondition),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IsEmptyCondition {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IsNullCondition {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HasIdCondition {
#[prost(message, repeated, tag = "1")]
pub has_id: ::prost::alloc::vec::Vec<PointId>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HasVectorCondition {
#[prost(string, tag = "1")]
pub has_vector: ::prost::alloc::string::String,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NestedCondition {
/// Path to nested object
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
/// Filter condition
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldCondition {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
/// Check if point has field with a given value
#[prost(message, optional, tag = "2")]
pub r#match: ::core::option::Option<Match>,
/// Check if points value lies in a given range
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<Range>,
/// Check if points geolocation lies in a given area
#[prost(message, optional, tag = "4")]
pub geo_bounding_box: ::core::option::Option<GeoBoundingBox>,
/// Check if geo point is within a given radius
#[prost(message, optional, tag = "5")]
pub geo_radius: ::core::option::Option<GeoRadius>,
/// Check number of values for a specific field
#[prost(message, optional, tag = "6")]
pub values_count: ::core::option::Option<ValuesCount>,
/// Check if geo point is within a given polygon
#[prost(message, optional, tag = "7")]
pub geo_polygon: ::core::option::Option<GeoPolygon>,
/// Check if datetime is within a given range
#[prost(message, optional, tag = "8")]
pub datetime_range: ::core::option::Option<DatetimeRange>,
/// Check if field is empty
#[prost(bool, optional, tag = "9")]
pub is_empty: ::core::option::Option<bool>,
/// Check if field is null
#[prost(bool, optional, tag = "10")]
pub is_null: ::core::option::Option<bool>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Match {
#[prost(oneof = "r#match::MatchValue", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11")]
pub match_value: ::core::option::Option<r#match::MatchValue>,
}
/// Nested message and enum types in `Match`.
pub mod r#match {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum MatchValue {
/// Match string keyword
#[prost(string, tag = "1")]
Keyword(::prost::alloc::string::String),
/// Match integer
#[prost(int64, tag = "2")]
Integer(i64),
/// Match boolean
#[prost(bool, tag = "3")]
Boolean(bool),
/// Match text
#[prost(string, tag = "4")]
Text(::prost::alloc::string::String),
/// Match multiple keywords
#[prost(message, tag = "5")]
Keywords(super::RepeatedStrings),
/// Match multiple integers
#[prost(message, tag = "6")]
Integers(super::RepeatedIntegers),
/// Match any other value except those integers
#[prost(message, tag = "7")]
ExceptIntegers(super::RepeatedIntegers),
/// Match any other value except those keywords
#[prost(message, tag = "8")]
ExceptKeywords(super::RepeatedStrings),
/// Match phrase text
#[prost(string, tag = "9")]
Phrase(::prost::alloc::string::String),
/// Match any word in the text
#[prost(string, tag = "10")]
TextAny(::prost::alloc::string::String),
/// Match keywords starting with the given prefix
#[prost(string, tag = "11")]
Prefix(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedStrings {
#[prost(string, repeated, tag = "1")]
pub strings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedIntegers {
#[prost(int64, repeated, tag = "1")]
pub integers: ::prost::alloc::vec::Vec<i64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Range {
#[prost(double, optional, tag = "1")]
pub lt: ::core::option::Option<f64>,
#[prost(double, optional, tag = "2")]
pub gt: ::core::option::Option<f64>,
#[prost(double, optional, tag = "3")]
pub gte: ::core::option::Option<f64>,
#[prost(double, optional, tag = "4")]
pub lte: ::core::option::Option<f64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatetimeRange {
#[prost(message, optional, tag = "1")]
#[validate(custom(function = "crate::grpc::validate::validate_timestamp"))]
pub lt: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "2")]
#[validate(custom(function = "crate::grpc::validate::validate_timestamp"))]
pub gt: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "3")]
#[validate(custom(function = "crate::grpc::validate::validate_timestamp"))]
pub gte: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "4")]
#[validate(custom(function = "crate::grpc::validate::validate_timestamp"))]
pub lte: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GeoBoundingBox {
/// north-west corner
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub top_left: ::core::option::Option<GeoPoint>,
/// south-east corner
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub bottom_right: ::core::option::Option<GeoPoint>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GeoRadius {
/// Center of the circle
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub center: ::core::option::Option<GeoPoint>,
/// In meters
#[prost(float, tag = "2")]
pub radius: f32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoLineString {
/// Ordered sequence of GeoPoints representing the line
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub points: ::prost::alloc::vec::Vec<GeoPoint>,
}
/// For a valid GeoPolygon, both the exterior and interior GeoLineStrings must
/// consist of a minimum of 4 points.
/// Additionally, the first and last points of each GeoLineString must be the same.
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoPolygon {
/// The exterior line bounds the surface
#[prost(message, optional, tag = "1")]
#[validate(
custom(function = "crate::grpc::validate::validate_geo_polygon_exterior"),
nested
)]
pub exterior: ::core::option::Option<GeoLineString>,
/// Interior lines (if present) bound holes within the surface
#[prost(message, repeated, tag = "2")]
#[validate(
custom(function = "crate::grpc::validate::validate_geo_polygon_interiors"),
nested
)]
pub interiors: ::prost::alloc::vec::Vec<GeoLineString>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValuesCount {
#[prost(uint64, optional, tag = "1")]
pub lt: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub gt: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub gte: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "4")]
pub lte: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VectorParams {
/// Size of the vectors
#[prost(uint64, tag = "1")]
#[validate(range(min = 1, max = 65536))]
pub size: u64,
/// Distance function used for comparing vectors
#[prost(enumeration = "Distance", tag = "2")]
pub distance: i32,
/// Configuration of vector HNSW graph.
/// If omitted - the collection configuration will be used
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
/// Configuration of vector quantization config.
/// If omitted - the collection configuration will be used
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub quantization_config: ::core::option::Option<QuantizationConfig>,
/// Deprecated: use `memory` instead.
/// If true - serve vectors from disk.
/// If set to false, the vectors will be loaded in RAM.
#[deprecated]
#[prost(bool, optional, tag = "5")]
pub on_disk: ::core::option::Option<bool>,
/// Data type of the vectors
#[prost(enumeration = "Datatype", optional, tag = "6")]
pub datatype: ::core::option::Option<i32>,
/// Configuration for multi-vector search
#[prost(message, optional, tag = "7")]
pub multivector_config: ::core::option::Option<MultiVectorConfig>,
/// Memory placement of the original vector storage.
/// Overrides the deprecated `on_disk` flag if both are set.
/// `Pinned` is not supported for dense vector storage.
#[prost(enumeration = "Memory", optional, tag = "8")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VectorParamsDiff {
/// Update params for HNSW index.
/// If empty object - it will be unset
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
/// Update quantization params. If none - it is left unchanged.
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub quantization_config: ::core::option::Option<QuantizationConfigDiff>,
/// Deprecated: use `memory` instead.
/// If true - serve vectors from disk.
/// If set to false, the vectors will be loaded in RAM.
#[deprecated]
#[prost(bool, optional, tag = "3")]
pub on_disk: ::core::option::Option<bool>,
/// Memory placement of the original vector storage.
/// Overrides the deprecated `on_disk` flag if both are set.
/// `Pinned` is not supported for dense vector storage.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorParamsMap {
#[prost(map = "string, message", tag = "1")]
#[validate(nested)]
pub map: ::std::collections::HashMap<::prost::alloc::string::String, VectorParams>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorParamsDiffMap {
#[prost(map = "string, message", tag = "1")]
#[validate(nested)]
pub map: ::std::collections::HashMap<
::prost::alloc::string::String,
VectorParamsDiff,
>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorsConfig {
#[prost(oneof = "vectors_config::Config", tags = "1, 2")]
#[validate(nested)]
pub config: ::core::option::Option<vectors_config::Config>,
}
/// Nested message and enum types in `VectorsConfig`.
pub mod vectors_config {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Config {
#[prost(message, tag = "1")]
Params(super::VectorParams),
#[prost(message, tag = "2")]
ParamsMap(super::VectorParamsMap),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorsConfigDiff {
#[prost(oneof = "vectors_config_diff::Config", tags = "1, 2")]
#[validate(nested)]
pub config: ::core::option::Option<vectors_config_diff::Config>,
}
/// Nested message and enum types in `VectorsConfigDiff`.
pub mod vectors_config_diff {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Config {
#[prost(message, tag = "1")]
Params(super::VectorParamsDiff),
#[prost(message, tag = "2")]
ParamsMap(super::VectorParamsDiffMap),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SparseVectorParams {
/// Configuration of sparse index
#[prost(message, optional, tag = "1")]
pub index: ::core::option::Option<SparseIndexConfig>,
/// If set - apply modifier to the vector values
#[prost(enumeration = "Modifier", optional, tag = "2")]
pub modifier: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SparseVectorConfig {
#[prost(map = "string, message", tag = "1")]
pub map: ::std::collections::HashMap<
::prost::alloc::string::String,
SparseVectorParams,
>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MultiVectorConfig {
/// Comparator for multi-vector search
#[prost(enumeration = "MultiVectorComparator", tag = "1")]
pub comparator: i32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCollectionInfoRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionExistsRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionExists {
#[prost(bool, tag = "1")]
pub exists: bool,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CollectionExistsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<CollectionExists>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCollectionsRequest {}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionDescription {
/// Name of the collection
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCollectionInfoResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<CollectionInfo>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCollectionsResponse {
#[prost(message, repeated, tag = "1")]
pub collections: ::prost::alloc::vec::Vec<CollectionDescription>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MaxOptimizationThreads {
#[prost(oneof = "max_optimization_threads::Variant", tags = "1, 2")]
pub variant: ::core::option::Option<max_optimization_threads::Variant>,
}
/// Nested message and enum types in `MaxOptimizationThreads`.
pub mod max_optimization_threads {
#[derive(serde::Serialize)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Setting {
Auto = 0,
}
impl Setting {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Auto => "Auto",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Auto" => Some(Self::Auto),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
#[prost(uint64, tag = "1")]
Value(u64),
#[prost(enumeration = "Setting", tag = "2")]
Setting(i32),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OptimizerStatus {
#[prost(bool, tag = "1")]
pub ok: bool,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionWarning {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HnswConfigDiff {
/// Number of edges per node in the index graph.
/// Larger the value - more accurate the search, more space required.
#[prost(uint64, optional, tag = "1")]
pub m: ::core::option::Option<u64>,
/// Number of neighbours to consider during the index building.
/// Larger the value - more accurate the search, more time required to build the index.
#[prost(uint64, optional, tag = "2")]
#[validate(range(min = 4))]
pub ef_construct: ::core::option::Option<u64>,
/// Minimal size threshold (in KiloBytes) below which full-scan is preferred over HNSW search.
/// This measures the total size of vectors being queried against.
/// When the maximum estimated amount of points that a condition satisfies is smaller than
/// `full_scan_threshold`, the query planner will use full-scan search instead of HNSW index
/// traversal for better performance.
/// Note: 1Kb = 1 vector of size 256
#[prost(uint64, optional, tag = "3")]
pub full_scan_threshold: ::core::option::Option<u64>,
/// Number of parallel threads used for background index building.
/// If 0 - automatically select from 8 to 16.
/// Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs.
/// On small CPUs, less threads are used.
#[prost(uint64, optional, tag = "4")]
pub max_indexing_threads: ::core::option::Option<u64>,
/// Deprecated: use `memory` instead.
/// Store HNSW index on disk. If set to false, the index will be stored in RAM.
#[deprecated]
#[prost(bool, optional, tag = "5")]
pub on_disk: ::core::option::Option<bool>,
/// Number of additional payload-aware links per node in the index graph.
/// If not set - regular M parameter will be used.
#[prost(uint64, optional, tag = "6")]
pub payload_m: ::core::option::Option<u64>,
/// Store copies of original and quantized vectors within the HNSW index file. Default: false.
/// Enabling this option will trade the search speed for disk usage by reducing amount of
/// random seeks during the search.
/// Requires quantized vectors to be enabled. Multi-vectors are not supported.
#[prost(bool, optional, tag = "7")]
pub inline_storage: ::core::option::Option<bool>,
/// Memory placement of the HNSW graph.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "8")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SparseIndexConfig {
/// Prefer a full scan search upto (excluding) this number of vectors.
/// Note: this is number of vectors, not KiloBytes.
#[prost(uint64, optional, tag = "1")]
pub full_scan_threshold: ::core::option::Option<u64>,
/// Deprecated: use `memory` instead.
/// Store inverted index on disk. If set to false, the index will be stored in RAM.
#[deprecated]
#[prost(bool, optional, tag = "2")]
pub on_disk: ::core::option::Option<bool>,
/// Datatype used to store weights in the index.
#[prost(enumeration = "Datatype", optional, tag = "3")]
#[validate(custom(function = "crate::grpc::validate::validate_sparse_datatype"))]
pub datatype: ::core::option::Option<i32>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WalConfigDiff {
/// Size of a single WAL block file
#[prost(uint64, optional, tag = "1")]
#[validate(range(min = 1))]
pub wal_capacity_mb: ::core::option::Option<u64>,
/// Number of segments to create in advance
#[prost(uint64, optional, tag = "2")]
pub wal_segments_ahead: ::core::option::Option<u64>,
/// Number of closed segments to retain
#[prost(uint64, optional, tag = "3")]
#[validate(range(min = 1))]
pub wal_retain_closed: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OptimizersConfigDiff {
/// The minimal fraction of deleted vectors in a segment, required to perform
/// segment optimization
#[prost(double, optional, tag = "1")]
#[validate(range(min = 0.0, max = 1.0))]
pub deleted_threshold: ::core::option::Option<f64>,
/// The minimal number of vectors in a segment, required to perform segment
/// optimization
#[prost(uint64, optional, tag = "2")]
#[validate(range(min = 100))]
pub vacuum_min_vector_number: ::core::option::Option<u64>,
/// Target amount of segments the optimizer will try to keep.
/// Real amount of segments may vary depending on multiple parameters:
///
/// * Amount of stored points.
/// * Current write RPS.
///
/// It is recommended to select the default number of segments as a factor of the number of search threads,
/// so that each segment would be handled evenly by one of the threads.
#[prost(uint64, optional, tag = "3")]
pub default_segment_number: ::core::option::Option<u64>,
/// Deprecated:
///
/// Do not create segments larger this size (in kilobytes).
/// Large segments might require disproportionately long indexation times,
/// therefore it makes sense to limit the size of segments.
///
/// If indexing speed is more important - make this parameter lower.
/// If search speed is more important - make this parameter higher.
/// Note: 1Kb = 1 vector of size 256
/// If not set, will be automatically selected considering the number of available CPUs.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub max_segment_size: ::core::option::Option<u64>,
/// Maximum size (in kilobytes) of vectors to store in-memory per segment.
/// Segments larger than this threshold will be stored as read-only memmapped file.
///
/// Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value.
///
/// To disable memmap storage, set this to `0`.
///
/// Note: 1Kb = 1 vector of size 256
#[prost(uint64, optional, tag = "5")]
pub memmap_threshold: ::core::option::Option<u64>,
/// Maximum size (in kilobytes) of vectors allowed for plain index, exceeding
/// this threshold will enable vector indexing
///
/// Default value is 20,000, based on
/// <<https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>.>
///
/// To disable vector indexing, set to `0`.
///
/// Note: 1kB = 1 vector of size 256.
#[prost(uint64, optional, tag = "6")]
pub indexing_threshold: ::core::option::Option<u64>,
/// Interval between forced flushes.
#[prost(uint64, optional, tag = "7")]
pub flush_interval_sec: ::core::option::Option<u64>,
/// Deprecated in favor of `max_optimization_threads`
#[prost(uint64, optional, tag = "8")]
pub deprecated_max_optimization_threads: ::core::option::Option<u64>,
/// Max number of threads (jobs) for running optimizations per shard.
/// Note: each optimization job will also use `max_indexing_threads` threads by itself for index building.
/// If "auto" - have no limit and choose dynamically to saturate CPU.
/// If 0 - no optimization threads, optimizations will be disabled.
#[prost(message, optional, tag = "9")]
pub max_optimization_threads: ::core::option::Option<MaxOptimizationThreads>,
/// If enabled, the service will try to prevent the creation of large unoptimized segments.
/// When enabled, new points written to segments larger than the indexing threshold are stored
/// as "deferred points": they are persisted in the WAL and segments, but excluded from
/// read/search results until the corresponding segments are optimized (e.g. indexed,
/// quantized, or moved to mmap storage).
/// Update requests with wait=true will only return after the deferred points become visible,
/// which may significantly increase the perceived latency between submitting an update and its
/// completion. Update requests with wait=false are not affected.
/// Default is disabled.
#[prost(bool, optional, tag = "10")]
pub prevent_unoptimized: ::core::option::Option<bool>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ScalarQuantization {
/// Type of quantization
#[prost(enumeration = "QuantizationType", tag = "1")]
pub r#type: i32,
/// Number of bits to use for quantization
#[prost(float, optional, tag = "2")]
#[validate(range(min = 0.5, max = 1.0))]
pub quantile: ::core::option::Option<f32>,
/// Deprecated: use `memory` instead.
/// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
#[deprecated]
#[prost(bool, optional, tag = "3")]
pub always_ram: ::core::option::Option<bool>,
/// Memory placement of quantized vectors.
/// Overrides the deprecated `always_ram` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProductQuantization {
/// Compression ratio
#[prost(enumeration = "CompressionRatio", tag = "1")]
pub compression: i32,
/// Deprecated: use `memory` instead.
/// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
#[deprecated]
#[prost(bool, optional, tag = "2")]
pub always_ram: ::core::option::Option<bool>,
/// Memory placement of quantized vectors.
/// Overrides the deprecated `always_ram` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "3")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BinaryQuantizationQueryEncoding {
#[prost(oneof = "binary_quantization_query_encoding::Variant", tags = "4")]
pub variant: ::core::option::Option<binary_quantization_query_encoding::Variant>,
}
/// Nested message and enum types in `BinaryQuantizationQueryEncoding`.
pub mod binary_quantization_query_encoding {
#[derive(serde::Serialize)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Setting {
Default = 0,
Binary = 1,
Scalar4Bits = 2,
Scalar8Bits = 3,
}
impl Setting {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "Default",
Self::Binary => "Binary",
Self::Scalar4Bits => "Scalar4Bits",
Self::Scalar8Bits => "Scalar8Bits",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Default" => Some(Self::Default),
"Binary" => Some(Self::Binary),
"Scalar4Bits" => Some(Self::Scalar4Bits),
"Scalar8Bits" => Some(Self::Scalar8Bits),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
#[prost(enumeration = "Setting", tag = "4")]
Setting(i32),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BinaryQuantization {
/// Deprecated: use `memory` instead.
/// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub always_ram: ::core::option::Option<bool>,
/// Binary quantization encoding method
#[prost(enumeration = "BinaryQuantizationEncoding", optional, tag = "2")]
pub encoding: ::core::option::Option<i32>,
/// Asymmetric quantization configuration allows a query to have different
/// quantization than stored vectors.
/// It can increase the accuracy of search at the cost of performance.
#[prost(message, optional, tag = "3")]
pub query_encoding: ::core::option::Option<BinaryQuantizationQueryEncoding>,
/// Memory placement of quantized vectors.
/// Overrides the deprecated `always_ram` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TurboQuantization {
/// Deprecated: use `memory` instead.
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub always_ram: ::core::option::Option<bool>,
#[prost(enumeration = "TurboQuantBitSize", optional, tag = "2")]
pub bits: ::core::option::Option<i32>,
/// Memory placement of quantized vectors.
/// Overrides the deprecated `always_ram` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "3")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuantizationConfig {
#[prost(oneof = "quantization_config::Quantization", tags = "1, 2, 3, 4")]
#[validate(nested)]
pub quantization: ::core::option::Option<quantization_config::Quantization>,
}
/// Nested message and enum types in `QuantizationConfig`.
pub mod quantization_config {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Quantization {
#[prost(message, tag = "1")]
Scalar(super::ScalarQuantization),
#[prost(message, tag = "2")]
Product(super::ProductQuantization),
#[prost(message, tag = "3")]
Binary(super::BinaryQuantization),
#[prost(message, tag = "4")]
Turboquant(super::TurboQuantization),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Disabled {}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuantizationConfigDiff {
#[prost(oneof = "quantization_config_diff::Quantization", tags = "1, 2, 3, 4, 5")]
#[validate(nested)]
pub quantization: ::core::option::Option<quantization_config_diff::Quantization>,
}
/// Nested message and enum types in `QuantizationConfigDiff`.
pub mod quantization_config_diff {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Quantization {
#[prost(message, tag = "1")]
Scalar(super::ScalarQuantization),
#[prost(message, tag = "2")]
Product(super::ProductQuantization),
#[prost(message, tag = "3")]
Disabled(super::Disabled),
#[prost(message, tag = "4")]
Binary(super::BinaryQuantization),
#[prost(message, tag = "5")]
Turboquant(super::TurboQuantization),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrictModeConfig {
/// Whether strict mode is enabled for a collection or not.
#[prost(bool, optional, tag = "1")]
pub enabled: ::core::option::Option<bool>,
/// Max allowed `limit` parameter for all APIs that don't have their own max limit.
#[prost(uint32, optional, tag = "2")]
#[validate(range(min = 1))]
pub max_query_limit: ::core::option::Option<u32>,
/// Max allowed `timeout` parameter.
#[prost(uint32, optional, tag = "3")]
#[validate(range(min = 1))]
pub max_timeout: ::core::option::Option<u32>,
/// Allow usage of unindexed fields in retrieval based (e.g. search) filters.
#[prost(bool, optional, tag = "4")]
pub unindexed_filtering_retrieve: ::core::option::Option<bool>,
/// Allow usage of unindexed fields in filtered updates (e.g. delete by payload).
#[prost(bool, optional, tag = "5")]
pub unindexed_filtering_update: ::core::option::Option<bool>,
/// Max HNSW ef value allowed in search parameters.
#[prost(uint32, optional, tag = "6")]
pub search_max_hnsw_ef: ::core::option::Option<u32>,
/// Whether exact search is allowed.
#[prost(bool, optional, tag = "7")]
pub search_allow_exact: ::core::option::Option<bool>,
/// Max oversampling value allowed in search
#[prost(float, optional, tag = "8")]
pub search_max_oversampling: ::core::option::Option<f32>,
/// Max batchsize when upserting
#[prost(uint64, optional, tag = "9")]
pub upsert_max_batchsize: ::core::option::Option<u64>,
/// Max batchsize when searching
#[prost(uint64, optional, tag = "20")]
pub search_max_batchsize: ::core::option::Option<u64>,
/// Max size of a collections vector storage in bytes, ignoring replicas.
#[prost(uint64, optional, tag = "10")]
pub max_collection_vector_size_bytes: ::core::option::Option<u64>,
/// Max number of read operations per minute per replica
#[prost(uint32, optional, tag = "11")]
#[validate(range(min = 1))]
pub read_rate_limit: ::core::option::Option<u32>,
/// Max number of write operations per minute per replica
#[prost(uint32, optional, tag = "12")]
#[validate(range(min = 1))]
pub write_rate_limit: ::core::option::Option<u32>,
/// Max size of a collections payload storage in bytes, ignoring replicas.
#[prost(uint64, optional, tag = "13")]
pub max_collection_payload_size_bytes: ::core::option::Option<u64>,
/// Max conditions a filter can have.
#[prost(uint64, optional, tag = "14")]
pub filter_max_conditions: ::core::option::Option<u64>,
/// Max size of a condition, eg. items in `MatchAny`.
#[prost(uint64, optional, tag = "15")]
pub condition_max_size: ::core::option::Option<u64>,
/// Multivector strict mode configuration
#[prost(message, optional, tag = "16")]
#[validate(nested)]
pub multivector_config: ::core::option::Option<StrictModeMultivectorConfig>,
/// Sparse vector strict mode configuration
#[prost(message, optional, tag = "17")]
#[validate(nested)]
pub sparse_config: ::core::option::Option<StrictModeSparseConfig>,
/// Max number of points estimated in a collection
#[prost(uint64, optional, tag = "18")]
#[validate(range(min = 1))]
pub max_points_count: ::core::option::Option<u64>,
/// Max number of payload indexes in a collection
#[prost(uint64, optional, tag = "19")]
pub max_payload_index_count: ::core::option::Option<u64>,
/// Reject memory-consuming update operations when process resident memory exceeds this percentage of total RAM (cgroup-aware, 1-100).
/// Delete-style operations are still allowed so memory can be freed.
#[prost(uint32, optional, tag = "21")]
#[validate(range(min = 1, max = 100))]
pub max_resident_memory_percent: ::core::option::Option<u32>,
/// Reject disk-consuming update operations when the filesystem hosting Qdrant storage exceeds this percentage of total capacity (1-100).
/// Free space is sampled with a small TTL cache so the gate may take a few seconds to react. Delete-style operations are still allowed so disk can be freed.
#[prost(uint32, optional, tag = "22")]
#[validate(range(min = 1, max = 100))]
pub max_disk_usage_percent: ::core::option::Option<u32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrictModeSparseConfig {
#[prost(map = "string, message", tag = "1")]
#[validate(nested)]
pub sparse_config: ::std::collections::HashMap<
::prost::alloc::string::String,
StrictModeSparse,
>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StrictModeSparse {
/// Max length of sparse vector
#[prost(uint64, optional, tag = "10")]
#[validate(range(min = 1))]
pub max_length: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StrictModeMultivectorConfig {
#[prost(map = "string, message", tag = "1")]
#[validate(nested)]
pub multivector_config: ::std::collections::HashMap<
::prost::alloc::string::String,
StrictModeMultivector,
>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StrictModeMultivector {
/// Max number of vectors in a multivector
#[prost(uint64, optional, tag = "1")]
#[validate(range(min = 1))]
pub max_vectors: ::core::option::Option<u64>,
}
/// Params of the payload storage
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadStorageParams {
/// Memory placement of the payload storage.
/// Overrides the deprecated `on_disk_payload` flag if both are set.
/// `Pinned` is not supported for payload storage.
#[prost(enumeration = "Memory", optional, tag = "1")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCollection {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name")
)]
pub collection_name: ::prost::alloc::string::String,
/// Configuration of vector index
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
/// Configuration of the Write-Ahead-Log
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub wal_config: ::core::option::Option<WalConfigDiff>,
/// Configuration of the optimizers
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub optimizers_config: ::core::option::Option<OptimizersConfigDiff>,
/// Number of shards in the collection, default is 1 for standalone, otherwise
/// equal to the number of nodes. Minimum is 1
#[prost(uint32, optional, tag = "7")]
#[validate(range(min = 1))]
pub shard_number: ::core::option::Option<u32>,
/// Deprecated: use `payload.memory` instead.
/// If true - point's payload will not be stored in memory
#[deprecated]
#[prost(bool, optional, tag = "8")]
pub on_disk_payload: ::core::option::Option<bool>,
/// Wait timeout for operation commit in seconds, if not specified - default
/// value will be supplied
#[prost(uint64, optional, tag = "9")]
pub timeout: ::core::option::Option<u64>,
/// Configuration for vectors
#[prost(message, optional, tag = "10")]
#[validate(nested)]
pub vectors_config: ::core::option::Option<VectorsConfig>,
/// Number of replicas of each shard that network tries to maintain, default = 1
#[prost(uint32, optional, tag = "11")]
#[validate(range(min = 1))]
pub replication_factor: ::core::option::Option<u32>,
/// How many replicas should apply the operation for us to consider it successful, default = 1
#[prost(uint32, optional, tag = "12")]
#[validate(range(min = 1))]
pub write_consistency_factor: ::core::option::Option<u32>,
/// Quantization configuration of vector
#[prost(message, optional, tag = "14")]
#[validate(nested)]
pub quantization_config: ::core::option::Option<QuantizationConfig>,
/// Sharding method
#[prost(enumeration = "ShardingMethod", optional, tag = "15")]
pub sharding_method: ::core::option::Option<i32>,
/// Configuration for sparse vectors
#[prost(message, optional, tag = "16")]
pub sparse_vectors_config: ::core::option::Option<SparseVectorConfig>,
/// Configuration for strict mode
#[prost(message, optional, tag = "17")]
#[validate(nested)]
pub strict_mode_config: ::core::option::Option<StrictModeConfig>,
/// Arbitrary JSON metadata for the collection
#[prost(map = "string, message", tag = "18")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
/// Configuration of the payload storage
#[prost(message, optional, tag = "19")]
pub payload: ::core::option::Option<PayloadStorageParams>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateCollection {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// New configuration parameters for the collection.
/// This operation is blocking, it will only proceed once all current
/// optimizations are complete
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub optimizers_config: ::core::option::Option<OptimizersConfigDiff>,
/// Wait timeout for operation commit in seconds if blocking.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "3")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// New configuration parameters for the collection
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub params: ::core::option::Option<CollectionParamsDiff>,
/// New HNSW parameters for the collection index
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
/// New vector parameters
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub vectors_config: ::core::option::Option<VectorsConfigDiff>,
/// Quantization configuration of vector
#[prost(message, optional, tag = "7")]
#[validate(nested)]
pub quantization_config: ::core::option::Option<QuantizationConfigDiff>,
/// New sparse vector parameters
#[prost(message, optional, tag = "8")]
pub sparse_vectors_config: ::core::option::Option<SparseVectorConfig>,
/// New strict mode configuration
#[prost(message, optional, tag = "9")]
#[validate(nested)]
pub strict_mode_config: ::core::option::Option<StrictModeConfig>,
/// Arbitrary JSON-like metadata for the collection, will be merged with
/// already stored metadata
#[prost(map = "string, message", tag = "10")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCollection {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait timeout for operation commit in seconds.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "2")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CollectionOperationResponse {
/// if operation made changes
#[prost(bool, tag = "1")]
pub result: bool,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionParams {
/// Number of shards in collection
#[prost(uint32, tag = "3")]
pub shard_number: u32,
/// Deprecated: use `payload.memory` instead.
/// If true - point's payload will not be stored in memory
#[deprecated]
#[prost(bool, tag = "4")]
pub on_disk_payload: bool,
/// Configuration for vectors
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub vectors_config: ::core::option::Option<VectorsConfig>,
/// Number of replicas of each shard that network tries to maintain
#[prost(uint32, optional, tag = "6")]
pub replication_factor: ::core::option::Option<u32>,
/// How many replicas should apply the operation for us to consider it successful
#[prost(uint32, optional, tag = "7")]
pub write_consistency_factor: ::core::option::Option<u32>,
/// Fan-out every read request to these many additional remote nodes (and return first available response)
#[prost(uint32, optional, tag = "8")]
pub read_fan_out_factor: ::core::option::Option<u32>,
/// Sharding method
#[prost(enumeration = "ShardingMethod", optional, tag = "9")]
pub sharding_method: ::core::option::Option<i32>,
/// Configuration for sparse vectors
#[prost(message, optional, tag = "10")]
pub sparse_vectors_config: ::core::option::Option<SparseVectorConfig>,
/// Define number of milliseconds to wait before attempting to read from another replica.
#[prost(uint64, optional, tag = "11")]
pub read_fan_out_delay_ms: ::core::option::Option<u64>,
/// Configuration of the payload storage
#[prost(message, optional, tag = "12")]
pub payload: ::core::option::Option<PayloadStorageParams>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionParamsDiff {
/// Number of replicas of each shard that network tries to maintain
#[prost(uint32, optional, tag = "1")]
#[validate(range(min = 1))]
pub replication_factor: ::core::option::Option<u32>,
/// How many replicas should apply the operation for us to consider it successful
#[prost(uint32, optional, tag = "2")]
#[validate(range(min = 1))]
pub write_consistency_factor: ::core::option::Option<u32>,
/// Deprecated: use `payload.memory` instead.
/// If true - point's payload will not be stored in memory
#[deprecated]
#[prost(bool, optional, tag = "3")]
pub on_disk_payload: ::core::option::Option<bool>,
/// Fan-out every read request to these many additional remote nodes (and return first available response)
#[prost(uint32, optional, tag = "4")]
pub read_fan_out_factor: ::core::option::Option<u32>,
/// Define number of milliseconds to wait before attempting to read from another replica.
#[prost(uint64, optional, tag = "5")]
pub read_fan_out_delay_ms: ::core::option::Option<u64>,
/// Update params of the payload storage
#[prost(message, optional, tag = "6")]
pub payload: ::core::option::Option<PayloadStorageParams>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionConfig {
/// Collection parameters
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<CollectionParams>,
/// Configuration of vector index
#[prost(message, optional, tag = "2")]
pub hnsw_config: ::core::option::Option<HnswConfigDiff>,
/// Configuration of the optimizers
#[prost(message, optional, tag = "3")]
pub optimizer_config: ::core::option::Option<OptimizersConfigDiff>,
/// Configuration of the Write-Ahead-Log
#[prost(message, optional, tag = "4")]
pub wal_config: ::core::option::Option<WalConfigDiff>,
/// Configuration of the vector quantization
#[prost(message, optional, tag = "5")]
pub quantization_config: ::core::option::Option<QuantizationConfig>,
/// Configuration of strict mode.
#[prost(message, optional, tag = "6")]
pub strict_mode_config: ::core::option::Option<StrictModeConfig>,
/// Arbitrary JSON metadata for the collection
#[prost(map = "string, message", tag = "7")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeywordIndexParams {
/// If true - used for tenant optimization.
#[prost(bool, optional, tag = "1")]
pub is_tenant: ::core::option::Option<bool>,
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "2")]
pub on_disk: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "3")]
pub enable_hnsw: ::core::option::Option<bool>,
/// If set, enable prefix matching (`match: { "prefix": ... }`) on this field.
#[prost(message, optional, tag = "4")]
pub prefix: ::core::option::Option<KeywordPrefixParams>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "5")]
pub memory: ::core::option::Option<i32>,
}
/// Prefix matching options for the keyword index. Has no options yet:
/// presence of this message enables prefix matching.
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeywordPrefixParams {}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IntegerIndexParams {
/// If true - support direct lookups. Default is true.
#[prost(bool, optional, tag = "1")]
pub lookup: ::core::option::Option<bool>,
/// If true - support ranges filters. Default is true.
#[prost(bool, optional, tag = "2")]
pub range: ::core::option::Option<bool>,
/// If true - use this key to organize storage of the collection data.
/// This option assumes that this key will be used in majority of filtered requests.
/// Default is false.
#[prost(bool, optional, tag = "3")]
pub is_principal: ::core::option::Option<bool>,
/// Deprecated: use `memory` instead.
/// If true - store index on disk. Default is false.
#[deprecated]
#[prost(bool, optional, tag = "4")]
pub on_disk: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "5")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "6")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FloatIndexParams {
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub on_disk: ::core::option::Option<bool>,
/// If true - use this key to organize storage of the collection data.
/// This option assumes that this key will be used in majority of filtered requests.
#[prost(bool, optional, tag = "2")]
pub is_principal: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "3")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeoIndexParams {
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub on_disk: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "2")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "3")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopwordsSet {
/// List of languages to use stopwords from
#[prost(string, repeated, tag = "1")]
pub languages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of custom stopwords
#[prost(string, repeated, tag = "2")]
pub custom: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TextIndexParams {
/// Tokenizer type
#[prost(enumeration = "TokenizerType", tag = "1")]
pub tokenizer: i32,
/// If true - all tokens will be lowercase
#[prost(bool, optional, tag = "2")]
pub lowercase: ::core::option::Option<bool>,
/// Minimal token length
#[prost(uint64, optional, tag = "3")]
pub min_token_len: ::core::option::Option<u64>,
/// Maximal token length
#[prost(uint64, optional, tag = "4")]
pub max_token_len: ::core::option::Option<u64>,
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "5")]
pub on_disk: ::core::option::Option<bool>,
/// Stopwords for the text index
#[prost(message, optional, tag = "6")]
pub stopwords: ::core::option::Option<StopwordsSet>,
/// If true - support phrase matching.
#[prost(bool, optional, tag = "7")]
pub phrase_matching: ::core::option::Option<bool>,
/// Set an algorithm for stemming.
#[prost(message, optional, tag = "8")]
pub stemmer: ::core::option::Option<StemmingAlgorithm>,
/// If true, normalize tokens by folding accented characters to ASCII (e.g., "ação" -> "acao").
/// Default: false.
#[prost(bool, optional, tag = "9")]
pub ascii_folding: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "10")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "11")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StemmingAlgorithm {
#[prost(oneof = "stemming_algorithm::StemmingParams", tags = "1, 2")]
pub stemming_params: ::core::option::Option<stemming_algorithm::StemmingParams>,
}
/// Nested message and enum types in `StemmingAlgorithm`.
pub mod stemming_algorithm {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum StemmingParams {
/// Parameters for snowball stemming
#[prost(message, tag = "1")]
Snowball(super::SnowballParams),
/// Explicitly disable stemming (overrides the language default)
#[prost(message, tag = "2")]
Disabled(super::DisabledStemmer),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnowballParams {
/// Which language the algorithm should stem.
#[prost(string, tag = "1")]
pub language: ::prost::alloc::string::String,
}
/// Marker selecting the "no stemming" algorithm.
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisabledStemmer {}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BoolIndexParams {
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub on_disk: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "2")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "3")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatetimeIndexParams {
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "1")]
pub on_disk: ::core::option::Option<bool>,
/// If true - use this key to organize storage of the collection data.
/// This option assumes that this key will be used in majority of filtered requests.
#[prost(bool, optional, tag = "2")]
pub is_principal: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "3")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UuidIndexParams {
/// If true - used for tenant optimization.
#[prost(bool, optional, tag = "1")]
pub is_tenant: ::core::option::Option<bool>,
/// Deprecated: use `memory` instead.
/// If true - store index on disk.
#[deprecated]
#[prost(bool, optional, tag = "2")]
pub on_disk: ::core::option::Option<bool>,
/// Enable HNSW graph building for this payload field.
/// If true, builds additional HNSW links (Need payload_m > 0).
/// Default: true.
#[prost(bool, optional, tag = "3")]
pub enable_hnsw: ::core::option::Option<bool>,
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
#[prost(enumeration = "Memory", optional, tag = "4")]
pub memory: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadIndexParams {
#[prost(
oneof = "payload_index_params::IndexParams",
tags = "3, 2, 4, 5, 1, 6, 7, 8"
)]
#[validate(nested)]
pub index_params: ::core::option::Option<payload_index_params::IndexParams>,
}
/// Nested message and enum types in `PayloadIndexParams`.
pub mod payload_index_params {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum IndexParams {
/// Parameters for keyword index
#[prost(message, tag = "3")]
KeywordIndexParams(super::KeywordIndexParams),
/// Parameters for integer index
#[prost(message, tag = "2")]
IntegerIndexParams(super::IntegerIndexParams),
/// Parameters for float index
#[prost(message, tag = "4")]
FloatIndexParams(super::FloatIndexParams),
/// Parameters for geo index
#[prost(message, tag = "5")]
GeoIndexParams(super::GeoIndexParams),
/// Parameters for text index
#[prost(message, tag = "1")]
TextIndexParams(super::TextIndexParams),
/// Parameters for bool index
#[prost(message, tag = "6")]
BoolIndexParams(super::BoolIndexParams),
/// Parameters for datetime index
#[prost(message, tag = "7")]
DatetimeIndexParams(super::DatetimeIndexParams),
/// Parameters for uuid index
#[prost(message, tag = "8")]
UuidIndexParams(super::UuidIndexParams),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadSchemaInfo {
/// Field data type
#[prost(enumeration = "PayloadSchemaType", tag = "1")]
pub data_type: i32,
/// Field index parameters
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<PayloadIndexParams>,
/// Number of points indexed within this field
#[prost(uint64, optional, tag = "3")]
pub points: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateQueueInfo {
/// Number of elements in the queue
#[prost(uint64, tag = "1")]
pub length: u64,
/// Number of points that are deferred (i.e hidden from search as they're not yet optimized).
#[prost(uint64, optional, tag = "2")]
pub deferred_points: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionInfo {
/// operating condition of the collection
#[prost(enumeration = "CollectionStatus", tag = "1")]
pub status: i32,
/// status of collection optimizers
#[prost(message, optional, tag = "2")]
pub optimizer_status: ::core::option::Option<OptimizerStatus>,
/// Number of independent segments
#[prost(uint64, tag = "4")]
pub segments_count: u64,
/// Configuration
#[prost(message, optional, tag = "7")]
pub config: ::core::option::Option<CollectionConfig>,
/// Collection data types
#[prost(map = "string, message", tag = "8")]
pub payload_schema: ::std::collections::HashMap<
::prost::alloc::string::String,
PayloadSchemaInfo,
>,
/// Approximate number of points in the collection
#[prost(uint64, optional, tag = "9")]
pub points_count: ::core::option::Option<u64>,
/// Approximate number of indexed vectors in the collection.
#[prost(uint64, optional, tag = "10")]
pub indexed_vectors_count: ::core::option::Option<u64>,
/// Warnings related to the collection
#[prost(message, repeated, tag = "11")]
pub warnings: ::prost::alloc::vec::Vec<CollectionWarning>,
/// Update queue info
#[prost(message, optional, tag = "12")]
pub update_queue: ::core::option::Option<UpdateQueueInfo>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeAliases {
/// List of actions
#[prost(message, repeated, tag = "1")]
pub actions: ::prost::alloc::vec::Vec<AliasOperations>,
/// Wait timeout for operation commit in seconds.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "2")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AliasOperations {
#[prost(oneof = "alias_operations::Action", tags = "1, 2, 3")]
pub action: ::core::option::Option<alias_operations::Action>,
}
/// Nested message and enum types in `AliasOperations`.
pub mod alias_operations {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Action {
#[prost(message, tag = "1")]
CreateAlias(super::CreateAlias),
#[prost(message, tag = "2")]
RenameAlias(super::RenameAlias),
#[prost(message, tag = "3")]
DeleteAlias(super::DeleteAlias),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateAlias {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
/// New name of the alias
#[prost(string, tag = "2")]
pub alias_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RenameAlias {
/// Name of the alias to rename
#[prost(string, tag = "1")]
pub old_alias_name: ::prost::alloc::string::String,
/// Name of the alias
#[prost(string, tag = "2")]
pub new_alias_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteAlias {
/// Name of the alias
#[prost(string, tag = "1")]
pub alias_name: ::prost::alloc::string::String,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListAliasesRequest {}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCollectionAliasesRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AliasDescription {
/// Name of the alias
#[prost(string, tag = "1")]
pub alias_name: ::prost::alloc::string::String,
/// Name of the collection
#[prost(string, tag = "2")]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAliasesResponse {
#[prost(message, repeated, tag = "1")]
pub aliases: ::prost::alloc::vec::Vec<AliasDescription>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionClusterInfoRequest {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardKey {
#[prost(oneof = "shard_key::Key", tags = "1, 2")]
pub key: ::core::option::Option<shard_key::Key>,
}
/// Nested message and enum types in `ShardKey`.
pub mod shard_key {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Key {
/// String key
#[prost(string, tag = "1")]
Keyword(::prost::alloc::string::String),
/// Number key
#[prost(uint64, tag = "2")]
Number(u64),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LocalShardInfo {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
/// Number of points in the shard
#[prost(uint64, tag = "2")]
pub points_count: u64,
/// Is replica active
#[prost(enumeration = "ReplicaState", tag = "3")]
pub state: i32,
/// User-defined shard key
#[prost(message, optional, tag = "4")]
pub shard_key: ::core::option::Option<ShardKey>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteShardInfo {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
/// Remote peer id
#[prost(uint64, tag = "2")]
pub peer_id: u64,
/// Is replica active
#[prost(enumeration = "ReplicaState", tag = "3")]
pub state: i32,
/// User-defined shard key
#[prost(message, optional, tag = "4")]
pub shard_key: ::core::option::Option<ShardKey>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardTransferInfo {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint32, optional, tag = "5")]
pub to_shard_id: ::core::option::Option<u32>,
#[prost(uint64, tag = "2")]
pub from: u64,
#[prost(uint64, tag = "3")]
pub to: u64,
/// If `true` transfer is a synchronization of a replicas;
/// If `false` transfer is a moving of a shard from one peer to another
#[prost(bool, tag = "4")]
pub sync: bool,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReshardingInfo {
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint64, tag = "2")]
pub peer_id: u64,
#[prost(message, optional, tag = "3")]
pub shard_key: ::core::option::Option<ShardKey>,
#[prost(enumeration = "ReshardingDirection", tag = "4")]
pub direction: i32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionClusterInfoResponse {
/// ID of this peer
#[prost(uint64, tag = "1")]
pub peer_id: u64,
/// Total number of shards
#[prost(uint64, tag = "2")]
pub shard_count: u64,
/// Local shards
#[prost(message, repeated, tag = "3")]
pub local_shards: ::prost::alloc::vec::Vec<LocalShardInfo>,
/// Remote shards
#[prost(message, repeated, tag = "4")]
pub remote_shards: ::prost::alloc::vec::Vec<RemoteShardInfo>,
/// Shard transfers
#[prost(message, repeated, tag = "5")]
pub shard_transfers: ::prost::alloc::vec::Vec<ShardTransferInfo>,
/// Resharding operations
#[prost(message, repeated, tag = "6")]
pub resharding_operations: ::prost::alloc::vec::Vec<ReshardingInfo>,
/// Time spent to process
#[prost(double, tag = "7")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MoveShard {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint32, optional, tag = "5")]
pub to_shard_id: ::core::option::Option<u32>,
#[prost(uint64, tag = "2")]
pub from_peer_id: u64,
#[prost(uint64, tag = "3")]
pub to_peer_id: u64,
#[prost(enumeration = "ShardTransferMethod", optional, tag = "4")]
pub method: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReplicateShard {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint32, optional, tag = "5")]
pub to_shard_id: ::core::option::Option<u32>,
#[prost(uint64, tag = "2")]
pub from_peer_id: u64,
#[prost(uint64, tag = "3")]
pub to_peer_id: u64,
#[prost(enumeration = "ShardTransferMethod", optional, tag = "4")]
pub method: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AbortShardTransfer {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint32, optional, tag = "4")]
pub to_shard_id: ::core::option::Option<u32>,
#[prost(uint64, tag = "2")]
pub from_peer_id: u64,
#[prost(uint64, tag = "3")]
pub to_peer_id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RestartTransfer {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint32, optional, tag = "5")]
pub to_shard_id: ::core::option::Option<u32>,
#[prost(uint64, tag = "2")]
pub from_peer_id: u64,
#[prost(uint64, tag = "3")]
pub to_peer_id: u64,
#[prost(enumeration = "ShardTransferMethod", tag = "4")]
pub method: i32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplicatePoints {
/// Source shard key
#[prost(message, optional, tag = "1")]
pub from_shard_key: ::core::option::Option<ShardKey>,
/// Target shard key
#[prost(message, optional, tag = "2")]
pub to_shard_key: ::core::option::Option<ShardKey>,
/// If set - only points matching the filter will be replicated
#[prost(message, optional, tag = "3")]
pub filter: ::core::option::Option<Filter>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Replica {
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint64, tag = "2")]
pub peer_id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateShardKey {
/// User-defined shard key
#[prost(message, optional, tag = "1")]
pub shard_key: ::core::option::Option<ShardKey>,
/// Number of shards to create per shard key
#[prost(uint32, optional, tag = "2")]
pub shards_number: ::core::option::Option<u32>,
/// Number of replicas of each shard to create
#[prost(uint32, optional, tag = "3")]
pub replication_factor: ::core::option::Option<u32>,
/// List of peer ids, allowed to create shards. If empty - all peers are allowed
#[prost(uint64, repeated, tag = "4")]
pub placement: ::prost::alloc::vec::Vec<u64>,
/// Initial state of created replicas. Warning: use with care.
#[prost(enumeration = "ReplicaState", optional, tag = "5")]
pub initial_state: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteShardKey {
/// Shard key to delete
#[prost(message, optional, tag = "1")]
pub shard_key: ::core::option::Option<ShardKey>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateCollectionClusterSetupRequest {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
/// Wait timeout for operation commit in seconds.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "6")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
#[prost(
oneof = "update_collection_cluster_setup_request::Operation",
tags = "2, 3, 4, 5, 7, 8, 9, 10"
)]
#[validate(nested)]
pub operation: ::core::option::Option<
update_collection_cluster_setup_request::Operation,
>,
}
/// Nested message and enum types in `UpdateCollectionClusterSetupRequest`.
pub mod update_collection_cluster_setup_request {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Operation {
#[prost(message, tag = "2")]
MoveShard(super::MoveShard),
#[prost(message, tag = "3")]
ReplicateShard(super::ReplicateShard),
#[prost(message, tag = "4")]
AbortTransfer(super::AbortShardTransfer),
#[prost(message, tag = "5")]
DropReplica(super::Replica),
#[prost(message, tag = "7")]
CreateShardKey(super::CreateShardKey),
#[prost(message, tag = "8")]
DeleteShardKey(super::DeleteShardKey),
#[prost(message, tag = "9")]
RestartTransfer(super::RestartTransfer),
#[prost(message, tag = "10")]
ReplicatePoints(super::ReplicatePoints),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateCollectionClusterSetupResponse {
#[prost(bool, tag = "1")]
pub result: bool,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateShardKeyRequest {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
/// Request to create shard key
#[prost(message, optional, tag = "2")]
pub request: ::core::option::Option<CreateShardKey>,
/// Wait timeout for operation commit in seconds.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "3")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteShardKeyRequest {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
/// Request to delete shard key
#[prost(message, optional, tag = "2")]
pub request: ::core::option::Option<DeleteShardKey>,
/// Wait timeout for operation commit in seconds.
/// If not specified - default value will be supplied.
#[prost(uint64, optional, tag = "3")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListShardKeysRequest {
/// Name of the collection
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreateShardKeyResponse {
#[prost(bool, tag = "1")]
pub result: bool,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteShardKeyResponse {
#[prost(bool, tag = "1")]
pub result: bool,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardKeyDescription {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<ShardKey>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListShardKeysResponse {
#[prost(message, repeated, tag = "1")]
pub shard_keys: ::prost::alloc::vec::Vec<ShardKeyDescription>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Datatype {
Default = 0,
Float32 = 1,
Uint8 = 2,
Float16 = 3,
Turbo4 = 4,
}
impl Datatype {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "Default",
Self::Float32 => "Float32",
Self::Uint8 => "Uint8",
Self::Float16 => "Float16",
Self::Turbo4 => "Turbo4",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Default" => Some(Self::Default),
"Float32" => Some(Self::Float32),
"Uint8" => Some(Self::Uint8),
"Float16" => Some(Self::Float16),
"Turbo4" => Some(Self::Turbo4),
_ => None,
}
}
}
/// Memory placement of a component's data.
/// Data is always persisted on disk regardless of this setting;
/// it only controls how the data is held in RAM.
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Memory {
Unknown = 0,
/// Data is not pre-loaded from disk to RAM; cached with usage.
Cold = 1,
/// Data is pre-loaded into disk-cache RAM on start, but may be evicted under memory pressure.
Cached = 2,
/// Data is loaded in RAM and never evicted.
Pinned = 3,
}
impl Memory {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "MemoryUnknown",
Self::Cold => "Cold",
Self::Cached => "Cached",
Self::Pinned => "Pinned",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MemoryUnknown" => Some(Self::Unknown),
"Cold" => Some(Self::Cold),
"Cached" => Some(Self::Cached),
"Pinned" => Some(Self::Pinned),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Modifier {
None = 0,
/// Apply Inverse Document Frequency
Idf = 1,
}
impl Modifier {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "None",
Self::Idf => "Idf",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"None" => Some(Self::None),
"Idf" => Some(Self::Idf),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MultiVectorComparator {
MaxSim = 0,
}
impl MultiVectorComparator {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::MaxSim => "MaxSim",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MaxSim" => Some(Self::MaxSim),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Distance {
UnknownDistance = 0,
Cosine = 1,
Euclid = 2,
Dot = 3,
Manhattan = 4,
}
impl Distance {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownDistance => "UnknownDistance",
Self::Cosine => "Cosine",
Self::Euclid => "Euclid",
Self::Dot => "Dot",
Self::Manhattan => "Manhattan",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownDistance" => Some(Self::UnknownDistance),
"Cosine" => Some(Self::Cosine),
"Euclid" => Some(Self::Euclid),
"Dot" => Some(Self::Dot),
"Manhattan" => Some(Self::Manhattan),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CollectionStatus {
UnknownCollectionStatus = 0,
/// All segments are ready
Green = 1,
/// Optimization in process
Yellow = 2,
/// Something went wrong
Red = 3,
/// Optimization is pending
Grey = 4,
}
impl CollectionStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownCollectionStatus => "UnknownCollectionStatus",
Self::Green => "Green",
Self::Yellow => "Yellow",
Self::Red => "Red",
Self::Grey => "Grey",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownCollectionStatus" => Some(Self::UnknownCollectionStatus),
"Green" => Some(Self::Green),
"Yellow" => Some(Self::Yellow),
"Red" => Some(Self::Red),
"Grey" => Some(Self::Grey),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PayloadSchemaType {
UnknownType = 0,
Keyword = 1,
Integer = 2,
Float = 3,
Geo = 4,
Text = 5,
Bool = 6,
Datetime = 7,
Uuid = 8,
}
impl PayloadSchemaType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownType => "UnknownType",
Self::Keyword => "Keyword",
Self::Integer => "Integer",
Self::Float => "Float",
Self::Geo => "Geo",
Self::Text => "Text",
Self::Bool => "Bool",
Self::Datetime => "Datetime",
Self::Uuid => "Uuid",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownType" => Some(Self::UnknownType),
"Keyword" => Some(Self::Keyword),
"Integer" => Some(Self::Integer),
"Float" => Some(Self::Float),
"Geo" => Some(Self::Geo),
"Text" => Some(Self::Text),
"Bool" => Some(Self::Bool),
"Datetime" => Some(Self::Datetime),
"Uuid" => Some(Self::Uuid),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QuantizationType {
UnknownQuantization = 0,
Int8 = 1,
}
impl QuantizationType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownQuantization => "UnknownQuantization",
Self::Int8 => "Int8",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownQuantization" => Some(Self::UnknownQuantization),
"Int8" => Some(Self::Int8),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompressionRatio {
X4 = 0,
X8 = 1,
X16 = 2,
X32 = 3,
X64 = 4,
}
impl CompressionRatio {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::X4 => "x4",
Self::X8 => "x8",
Self::X16 => "x16",
Self::X32 => "x32",
Self::X64 => "x64",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"x4" => Some(Self::X4),
"x8" => Some(Self::X8),
"x16" => Some(Self::X16),
"x32" => Some(Self::X32),
"x64" => Some(Self::X64),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BinaryQuantizationEncoding {
OneBit = 0,
TwoBits = 1,
OneAndHalfBits = 2,
}
impl BinaryQuantizationEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::OneBit => "OneBit",
Self::TwoBits => "TwoBits",
Self::OneAndHalfBits => "OneAndHalfBits",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OneBit" => Some(Self::OneBit),
"TwoBits" => Some(Self::TwoBits),
"OneAndHalfBits" => Some(Self::OneAndHalfBits),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TurboQuantBitSize {
Bits1 = 0,
Bits15 = 1,
Bits2 = 2,
Bits4 = 3,
}
impl TurboQuantBitSize {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Bits1 => "Bits1",
Self::Bits15 => "Bits1_5",
Self::Bits2 => "Bits2",
Self::Bits4 => "Bits4",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Bits1" => Some(Self::Bits1),
"Bits1_5" => Some(Self::Bits15),
"Bits2" => Some(Self::Bits2),
"Bits4" => Some(Self::Bits4),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ShardingMethod {
/// Auto-sharding based on record ids
Auto = 0,
/// Shard by user-defined key
Custom = 1,
}
impl ShardingMethod {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Auto => "Auto",
Self::Custom => "Custom",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Auto" => Some(Self::Auto),
"Custom" => Some(Self::Custom),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TokenizerType {
Unknown = 0,
Prefix = 1,
Whitespace = 2,
Word = 3,
Multilingual = 4,
}
impl TokenizerType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "Unknown",
Self::Prefix => "Prefix",
Self::Whitespace => "Whitespace",
Self::Word => "Word",
Self::Multilingual => "Multilingual",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unknown" => Some(Self::Unknown),
"Prefix" => Some(Self::Prefix),
"Whitespace" => Some(Self::Whitespace),
"Word" => Some(Self::Word),
"Multilingual" => Some(Self::Multilingual),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReplicaState {
/// Active and sound
Active = 0,
/// Failed for some reason
Dead = 1,
/// The shard is partially loaded and is currently receiving data from other shards
Partial = 2,
/// Collection is being created
Initializing = 3,
/// A shard which receives data, but is not used for search.
/// Useful for backup shards.
Listener = 4,
/// Deprecated: snapshot shard transfer is in progress.
/// Updates should not be sent to (and are ignored by) the shard.
PartialSnapshot = 5,
/// Shard is undergoing recovery by an external node.
/// Normally rejects updates, accepts updates if force is true.
Recovery = 6,
/// Points are being migrated to this shard as part of scale-up resharding
Resharding = 7,
/// Points are being migrated to this shard as part of scale-down resharding
ReshardingScaleDown = 8,
/// Active for readers, Partial for writers
ActiveRead = 9,
/// State for manually creation/recovery of a shard.
/// Usually when snapshot is uploaded.
/// This state is equivalent to `Partial`, except:
///
/// * it can't receive updates
/// * it is not treated as broken on startup
ManualRecovery = 10,
}
impl ReplicaState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Active => "Active",
Self::Dead => "Dead",
Self::Partial => "Partial",
Self::Initializing => "Initializing",
Self::Listener => "Listener",
Self::PartialSnapshot => "PartialSnapshot",
Self::Recovery => "Recovery",
Self::Resharding => "Resharding",
Self::ReshardingScaleDown => "ReshardingScaleDown",
Self::ActiveRead => "ActiveRead",
Self::ManualRecovery => "ManualRecovery",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Active" => Some(Self::Active),
"Dead" => Some(Self::Dead),
"Partial" => Some(Self::Partial),
"Initializing" => Some(Self::Initializing),
"Listener" => Some(Self::Listener),
"PartialSnapshot" => Some(Self::PartialSnapshot),
"Recovery" => Some(Self::Recovery),
"Resharding" => Some(Self::Resharding),
"ReshardingScaleDown" => Some(Self::ReshardingScaleDown),
"ActiveRead" => Some(Self::ActiveRead),
"ManualRecovery" => Some(Self::ManualRecovery),
_ => None,
}
}
}
/// Resharding direction, scale up or down in number of shards
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReshardingDirection {
/// Scale up, add a new shard
Up = 0,
/// Scale down, remove a shard
Down = 1,
}
impl ReshardingDirection {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Up => "Up",
Self::Down => "Down",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Up" => Some(Self::Up),
"Down" => Some(Self::Down),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ShardTransferMethod {
/// Stream shard records in batches
StreamRecords = 0,
/// Snapshot the shard and recover it on the target peer
Snapshot = 1,
/// Resolve WAL delta between peers and transfer the difference
WalDelta = 2,
/// Stream shard records in batches for resharding
ReshardingStreamRecords = 3,
}
impl ShardTransferMethod {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::StreamRecords => "StreamRecords",
Self::Snapshot => "Snapshot",
Self::WalDelta => "WalDelta",
Self::ReshardingStreamRecords => "ReshardingStreamRecords",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"StreamRecords" => Some(Self::StreamRecords),
"Snapshot" => Some(Self::Snapshot),
"WalDelta" => Some(Self::WalDelta),
"ReshardingStreamRecords" => Some(Self::ReshardingStreamRecords),
_ => None,
}
}
}
/// Generated client implementations.
pub mod collections_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 CollectionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CollectionsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> CollectionsClient<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,
) -> CollectionsClient<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,
{
CollectionsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Get detailed information about specified existing collection
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetCollectionInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetCollectionInfoResponse>,
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("/qdrant.Collections/Get");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Get"));
self.inner.unary(req, path, codec).await
}
/// Get list of names of all existing collections
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListCollectionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCollectionsResponse>,
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("/qdrant.Collections/List");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "List"));
self.inner.unary(req, path, codec).await
}
/// Create new collection with given parameters
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.Collections/Create",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Create"));
self.inner.unary(req, path, codec).await
}
/// Update parameters of the existing collection
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.Collections/Update",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Update"));
self.inner.unary(req, path, codec).await
}
/// Drop collection and all associated data
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.Collections/Delete",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Collections", "Delete"));
self.inner.unary(req, path, codec).await
}
/// Update Aliases of the existing collection
pub async fn update_aliases(
&mut self,
request: impl tonic::IntoRequest<super::ChangeAliases>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.Collections/UpdateAliases",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "UpdateAliases"));
self.inner.unary(req, path, codec).await
}
/// Get list of all aliases for a collection
pub async fn list_collection_aliases(
&mut self,
request: impl tonic::IntoRequest<super::ListCollectionAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAliasesResponse>,
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(
"/qdrant.Collections/ListCollectionAliases",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "ListCollectionAliases"));
self.inner.unary(req, path, codec).await
}
/// Get list of all aliases for all existing collections
pub async fn list_aliases(
&mut self,
request: impl tonic::IntoRequest<super::ListAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAliasesResponse>,
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(
"/qdrant.Collections/ListAliases",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "ListAliases"));
self.inner.unary(req, path, codec).await
}
/// Get cluster information for a collection
pub async fn collection_cluster_info(
&mut self,
request: impl tonic::IntoRequest<super::CollectionClusterInfoRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionClusterInfoResponse>,
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(
"/qdrant.Collections/CollectionClusterInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "CollectionClusterInfo"));
self.inner.unary(req, path, codec).await
}
/// Check the existence of a collection
pub async fn collection_exists(
&mut self,
request: impl tonic::IntoRequest<super::CollectionExistsRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionExistsResponse>,
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(
"/qdrant.Collections/CollectionExists",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "CollectionExists"));
self.inner.unary(req, path, codec).await
}
/// Update cluster setup for a collection
pub async fn update_collection_cluster_setup(
&mut self,
request: impl tonic::IntoRequest<super::UpdateCollectionClusterSetupRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateCollectionClusterSetupResponse>,
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(
"/qdrant.Collections/UpdateCollectionClusterSetup",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("qdrant.Collections", "UpdateCollectionClusterSetup"),
);
self.inner.unary(req, path, codec).await
}
/// Create shard key
pub async fn create_shard_key(
&mut self,
request: impl tonic::IntoRequest<super::CreateShardKeyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateShardKeyResponse>,
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(
"/qdrant.Collections/CreateShardKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "CreateShardKey"));
self.inner.unary(req, path, codec).await
}
/// Delete shard key
pub async fn delete_shard_key(
&mut self,
request: impl tonic::IntoRequest<super::DeleteShardKeyRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteShardKeyResponse>,
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(
"/qdrant.Collections/DeleteShardKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "DeleteShardKey"));
self.inner.unary(req, path, codec).await
}
/// List shard keys
pub async fn list_shard_keys(
&mut self,
request: impl tonic::IntoRequest<super::ListShardKeysRequest>,
) -> std::result::Result<
tonic::Response<super::ListShardKeysResponse>,
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(
"/qdrant.Collections/ListShardKeys",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Collections", "ListShardKeys"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod collections_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with CollectionsServer.
#[async_trait]
pub trait Collections: std::marker::Send + std::marker::Sync + 'static {
/// Get detailed information about specified existing collection
async fn get(
&self,
request: tonic::Request<super::GetCollectionInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetCollectionInfoResponse>,
tonic::Status,
>;
/// Get list of names of all existing collections
async fn list(
&self,
request: tonic::Request<super::ListCollectionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCollectionsResponse>,
tonic::Status,
>;
/// Create new collection with given parameters
async fn create(
&self,
request: tonic::Request<super::CreateCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Update parameters of the existing collection
async fn update(
&self,
request: tonic::Request<super::UpdateCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Drop collection and all associated data
async fn delete(
&self,
request: tonic::Request<super::DeleteCollection>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Update Aliases of the existing collection
async fn update_aliases(
&self,
request: tonic::Request<super::ChangeAliases>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Get list of all aliases for a collection
async fn list_collection_aliases(
&self,
request: tonic::Request<super::ListCollectionAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAliasesResponse>,
tonic::Status,
>;
/// Get list of all aliases for all existing collections
async fn list_aliases(
&self,
request: tonic::Request<super::ListAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAliasesResponse>,
tonic::Status,
>;
/// Get cluster information for a collection
async fn collection_cluster_info(
&self,
request: tonic::Request<super::CollectionClusterInfoRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionClusterInfoResponse>,
tonic::Status,
>;
/// Check the existence of a collection
async fn collection_exists(
&self,
request: tonic::Request<super::CollectionExistsRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionExistsResponse>,
tonic::Status,
>;
/// Update cluster setup for a collection
async fn update_collection_cluster_setup(
&self,
request: tonic::Request<super::UpdateCollectionClusterSetupRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateCollectionClusterSetupResponse>,
tonic::Status,
>;
/// Create shard key
async fn create_shard_key(
&self,
request: tonic::Request<super::CreateShardKeyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateShardKeyResponse>,
tonic::Status,
>;
/// Delete shard key
async fn delete_shard_key(
&self,
request: tonic::Request<super::DeleteShardKeyRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteShardKeyResponse>,
tonic::Status,
>;
/// List shard keys
async fn list_shard_keys(
&self,
request: tonic::Request<super::ListShardKeysRequest>,
) -> std::result::Result<
tonic::Response<super::ListShardKeysResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct CollectionsServer<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> CollectionsServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 CollectionsServer<T>
where
T: Collections,
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() {
"/qdrant.Collections/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::GetCollectionInfoRequest>
for GetSvc<T> {
type Response = super::GetCollectionInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetCollectionInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::get(&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 = GetSvc(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)
}
"/qdrant.Collections/List" => {
#[allow(non_camel_case_types)]
struct ListSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ListCollectionsRequest>
for ListSvc<T> {
type Response = super::ListCollectionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListCollectionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::list(&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 = ListSvc(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)
}
"/qdrant.Collections/Create" => {
#[allow(non_camel_case_types)]
struct CreateSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::CreateCollection>
for CreateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateCollection>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::create(&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 = CreateSvc(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)
}
"/qdrant.Collections/Update" => {
#[allow(non_camel_case_types)]
struct UpdateSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::UpdateCollection>
for UpdateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateCollection>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::update(&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 = UpdateSvc(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)
}
"/qdrant.Collections/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::DeleteCollection>
for DeleteSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCollection>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::delete(&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 = DeleteSvc(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)
}
"/qdrant.Collections/UpdateAliases" => {
#[allow(non_camel_case_types)]
struct UpdateAliasesSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ChangeAliases>
for UpdateAliasesSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ChangeAliases>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::update_aliases(&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 = UpdateAliasesSvc(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)
}
"/qdrant.Collections/ListCollectionAliases" => {
#[allow(non_camel_case_types)]
struct ListCollectionAliasesSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ListCollectionAliasesRequest>
for ListCollectionAliasesSvc<T> {
type Response = super::ListAliasesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListCollectionAliasesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::list_collection_aliases(&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 = ListCollectionAliasesSvc(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)
}
"/qdrant.Collections/ListAliases" => {
#[allow(non_camel_case_types)]
struct ListAliasesSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ListAliasesRequest>
for ListAliasesSvc<T> {
type Response = super::ListAliasesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListAliasesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::list_aliases(&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 = ListAliasesSvc(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)
}
"/qdrant.Collections/CollectionClusterInfo" => {
#[allow(non_camel_case_types)]
struct CollectionClusterInfoSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::CollectionClusterInfoRequest>
for CollectionClusterInfoSvc<T> {
type Response = super::CollectionClusterInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CollectionClusterInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::collection_cluster_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 = CollectionClusterInfoSvc(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)
}
"/qdrant.Collections/CollectionExists" => {
#[allow(non_camel_case_types)]
struct CollectionExistsSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::CollectionExistsRequest>
for CollectionExistsSvc<T> {
type Response = super::CollectionExistsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CollectionExistsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::collection_exists(&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 = CollectionExistsSvc(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)
}
"/qdrant.Collections/UpdateCollectionClusterSetup" => {
#[allow(non_camel_case_types)]
struct UpdateCollectionClusterSetupSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<
super::UpdateCollectionClusterSetupRequest,
> for UpdateCollectionClusterSetupSvc<T> {
type Response = super::UpdateCollectionClusterSetupResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UpdateCollectionClusterSetupRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::update_collection_cluster_setup(
&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 = UpdateCollectionClusterSetupSvc(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)
}
"/qdrant.Collections/CreateShardKey" => {
#[allow(non_camel_case_types)]
struct CreateShardKeySvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::CreateShardKeyRequest>
for CreateShardKeySvc<T> {
type Response = super::CreateShardKeyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateShardKeyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::create_shard_key(&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 = CreateShardKeySvc(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)
}
"/qdrant.Collections/DeleteShardKey" => {
#[allow(non_camel_case_types)]
struct DeleteShardKeySvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::DeleteShardKeyRequest>
for DeleteShardKeySvc<T> {
type Response = super::DeleteShardKeyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteShardKeyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::delete_shard_key(&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 = DeleteShardKeySvc(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)
}
"/qdrant.Collections/ListShardKeys" => {
#[allow(non_camel_case_types)]
struct ListShardKeysSvc<T: Collections>(pub Arc<T>);
impl<
T: Collections,
> tonic::server::UnaryService<super::ListShardKeysRequest>
for ListShardKeysSvc<T> {
type Response = super::ListShardKeysResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListShardKeysRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Collections>::list_shard_keys(&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 = ListShardKeysSvc(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 CollectionsServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.Collections";
impl<T> tonic::server::NamedService for CollectionsServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCollectionInfoRequestInternal {
#[prost(message, optional, tag = "1")]
pub get_collection_info_request: ::core::option::Option<GetCollectionInfoRequest>,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InitiateShardTransferRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the temporary shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WaitForShardStateRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
/// Shard state to wait for
#[prost(enumeration = "ReplicaState", tag = "3")]
pub state: i32,
/// Timeout in seconds
#[prost(uint64, tag = "4")]
#[validate(range(min = 1))]
pub timeout: u64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetShardRecoveryPointRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardRecoveryPointResponse {
/// Recovery point of the shard
#[prost(message, optional, tag = "1")]
pub recovery_point: ::core::option::Option<RecoveryPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecoveryPoint {
#[prost(message, repeated, tag = "1")]
pub clocks: ::prost::alloc::vec::Vec<RecoveryPointClockTag>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecoveryPointClockTag {
#[prost(uint64, tag = "1")]
pub peer_id: u64,
#[prost(uint32, tag = "2")]
pub clock_id: u32,
#[prost(uint64, tag = "3")]
pub clock_tick: u64,
#[prost(uint64, tag = "4")]
pub token: u64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateShardCutoffPointRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
/// Cutoff point of the shard
#[prost(message, optional, tag = "3")]
pub cutoff: ::core::option::Option<RecoveryPoint>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetShardOptimizationsRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
/// Whether to include queued optimizations
#[prost(bool, tag = "3")]
pub with_queued: bool,
/// Limit for completed optimizations (0 means not included)
#[prost(uint32, optional, tag = "4")]
pub completed_limit: ::core::option::Option<u32>,
/// Whether to include idle segments
#[prost(bool, tag = "5")]
pub with_idle_segments: bool,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardOptimizationsResponse {
/// JSON-serialized OptimizationsResponse
#[prost(bytes = "vec", tag = "1")]
pub optimizations_json: ::prost::alloc::vec::Vec<u8>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetShardMemoryReportRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardMemoryReportResponse {
/// JSON-serialized CollectionMemoryReport
#[prost(bytes = "vec", tag = "1")]
pub memory_report_json: ::prost::alloc::vec::Vec<u8>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
/// Generated client implementations.
pub mod collections_internal_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 CollectionsInternalClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CollectionsInternalClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> CollectionsInternalClient<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,
) -> CollectionsInternalClient<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,
{
CollectionsInternalClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Get collection info
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetCollectionInfoRequestInternal>,
) -> std::result::Result<
tonic::Response<super::GetCollectionInfoResponse>,
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(
"/qdrant.CollectionsInternal/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.CollectionsInternal", "Get"));
self.inner.unary(req, path, codec).await
}
/// Initiate shard transfer
pub async fn initiate(
&mut self,
request: impl tonic::IntoRequest<super::InitiateShardTransferRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.CollectionsInternal/Initiate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.CollectionsInternal", "Initiate"));
self.inner.unary(req, path, codec).await
}
/// Wait for a shard to get into the given state
pub async fn wait_for_shard_state(
&mut self,
request: impl tonic::IntoRequest<super::WaitForShardStateRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.CollectionsInternal/WaitForShardState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("qdrant.CollectionsInternal", "WaitForShardState"),
);
self.inner.unary(req, path, codec).await
}
/// Get shard recovery point
pub async fn get_shard_recovery_point(
&mut self,
request: impl tonic::IntoRequest<super::GetShardRecoveryPointRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardRecoveryPointResponse>,
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(
"/qdrant.CollectionsInternal/GetShardRecoveryPoint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.CollectionsInternal",
"GetShardRecoveryPoint",
),
);
self.inner.unary(req, path, codec).await
}
/// Update shard cutoff point
pub async fn update_shard_cutoff_point(
&mut self,
request: impl tonic::IntoRequest<super::UpdateShardCutoffPointRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
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(
"/qdrant.CollectionsInternal/UpdateShardCutoffPoint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.CollectionsInternal",
"UpdateShardCutoffPoint",
),
);
self.inner.unary(req, path, codec).await
}
/// Get shard optimizations info
pub async fn get_shard_optimizations(
&mut self,
request: impl tonic::IntoRequest<super::GetShardOptimizationsRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardOptimizationsResponse>,
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(
"/qdrant.CollectionsInternal/GetShardOptimizations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.CollectionsInternal",
"GetShardOptimizations",
),
);
self.inner.unary(req, path, codec).await
}
/// Get shard memory usage report
pub async fn get_shard_memory_report(
&mut self,
request: impl tonic::IntoRequest<super::GetShardMemoryReportRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardMemoryReportResponse>,
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(
"/qdrant.CollectionsInternal/GetShardMemoryReport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("qdrant.CollectionsInternal", "GetShardMemoryReport"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod collections_internal_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with CollectionsInternalServer.
#[async_trait]
pub trait CollectionsInternal: std::marker::Send + std::marker::Sync + 'static {
/// Get collection info
async fn get(
&self,
request: tonic::Request<super::GetCollectionInfoRequestInternal>,
) -> std::result::Result<
tonic::Response<super::GetCollectionInfoResponse>,
tonic::Status,
>;
/// Initiate shard transfer
async fn initiate(
&self,
request: tonic::Request<super::InitiateShardTransferRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Wait for a shard to get into the given state
async fn wait_for_shard_state(
&self,
request: tonic::Request<super::WaitForShardStateRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Get shard recovery point
async fn get_shard_recovery_point(
&self,
request: tonic::Request<super::GetShardRecoveryPointRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardRecoveryPointResponse>,
tonic::Status,
>;
/// Update shard cutoff point
async fn update_shard_cutoff_point(
&self,
request: tonic::Request<super::UpdateShardCutoffPointRequest>,
) -> std::result::Result<
tonic::Response<super::CollectionOperationResponse>,
tonic::Status,
>;
/// Get shard optimizations info
async fn get_shard_optimizations(
&self,
request: tonic::Request<super::GetShardOptimizationsRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardOptimizationsResponse>,
tonic::Status,
>;
/// Get shard memory usage report
async fn get_shard_memory_report(
&self,
request: tonic::Request<super::GetShardMemoryReportRequest>,
) -> std::result::Result<
tonic::Response<super::GetShardMemoryReportResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct CollectionsInternalServer<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> CollectionsInternalServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 CollectionsInternalServer<T>
where
T: CollectionsInternal,
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() {
"/qdrant.CollectionsInternal/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<
super::GetCollectionInfoRequestInternal,
> for GetSvc<T> {
type Response = super::GetCollectionInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::GetCollectionInfoRequestInternal,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::get(&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 = GetSvc(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)
}
"/qdrant.CollectionsInternal/Initiate" => {
#[allow(non_camel_case_types)]
struct InitiateSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::InitiateShardTransferRequest>
for InitiateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InitiateShardTransferRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::initiate(&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 = InitiateSvc(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)
}
"/qdrant.CollectionsInternal/WaitForShardState" => {
#[allow(non_camel_case_types)]
struct WaitForShardStateSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::WaitForShardStateRequest>
for WaitForShardStateSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::WaitForShardStateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::wait_for_shard_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 = WaitForShardStateSvc(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)
}
"/qdrant.CollectionsInternal/GetShardRecoveryPoint" => {
#[allow(non_camel_case_types)]
struct GetShardRecoveryPointSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::GetShardRecoveryPointRequest>
for GetShardRecoveryPointSvc<T> {
type Response = super::GetShardRecoveryPointResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetShardRecoveryPointRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::get_shard_recovery_point(
&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 = GetShardRecoveryPointSvc(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)
}
"/qdrant.CollectionsInternal/UpdateShardCutoffPoint" => {
#[allow(non_camel_case_types)]
struct UpdateShardCutoffPointSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::UpdateShardCutoffPointRequest>
for UpdateShardCutoffPointSvc<T> {
type Response = super::CollectionOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateShardCutoffPointRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::update_shard_cutoff_point(
&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 = UpdateShardCutoffPointSvc(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)
}
"/qdrant.CollectionsInternal/GetShardOptimizations" => {
#[allow(non_camel_case_types)]
struct GetShardOptimizationsSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::GetShardOptimizationsRequest>
for GetShardOptimizationsSvc<T> {
type Response = super::GetShardOptimizationsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetShardOptimizationsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::get_shard_optimizations(
&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 = GetShardOptimizationsSvc(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)
}
"/qdrant.CollectionsInternal/GetShardMemoryReport" => {
#[allow(non_camel_case_types)]
struct GetShardMemoryReportSvc<T: CollectionsInternal>(pub Arc<T>);
impl<
T: CollectionsInternal,
> tonic::server::UnaryService<super::GetShardMemoryReportRequest>
for GetShardMemoryReportSvc<T> {
type Response = super::GetShardMemoryReportResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetShardMemoryReportRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as CollectionsInternal>::get_shard_memory_report(
&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 = GetShardMemoryReportSvc(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 CollectionsInternalServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.CollectionsInternal";
impl<T> tonic::server::NamedService for CollectionsInternalServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WriteOrdering {
/// Write ordering guarantees
#[prost(enumeration = "WriteOrderingType", tag = "1")]
pub r#type: i32,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadConsistency {
#[prost(oneof = "read_consistency::Value", tags = "1, 2")]
pub value: ::core::option::Option<read_consistency::Value>,
}
/// Nested message and enum types in `ReadConsistency`.
pub mod read_consistency {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Value {
/// Common read consistency configurations
#[prost(enumeration = "super::ReadConsistencyType", tag = "1")]
Type(i32),
/// Send request to a specified number of nodes,
/// and return points which are present on all of them
#[prost(uint64, tag = "2")]
Factor(u64),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SparseIndices {
#[prost(uint32, repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Document {
/// Text of the document
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
/// Model name
#[prost(string, tag = "3")]
pub model: ::prost::alloc::string::String,
/// Model options
#[prost(map = "string, message", tag = "4")]
pub options: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Image {
/// Image data, either base64 encoded or URL
#[prost(message, optional, tag = "1")]
pub image: ::core::option::Option<Value>,
/// Model name
#[prost(string, tag = "2")]
pub model: ::prost::alloc::string::String,
/// Model options
#[prost(map = "string, message", tag = "3")]
pub options: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InferenceObject {
/// Object to infer
#[prost(message, optional, tag = "1")]
pub object: ::core::option::Option<Value>,
/// Model name
#[prost(string, tag = "2")]
pub model: ::prost::alloc::string::String,
/// Model options
#[prost(map = "string, message", tag = "3")]
pub options: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Vector {
/// Vector data (flatten for multi vectors), deprecated
#[deprecated]
#[prost(float, repeated, packed = "false", tag = "1")]
pub data: ::prost::alloc::vec::Vec<f32>,
/// Sparse indices for sparse vectors, deprecated
#[deprecated]
#[prost(message, optional, tag = "2")]
pub indices: ::core::option::Option<SparseIndices>,
/// Number of vectors per multi vector, deprecated
#[deprecated]
#[prost(uint32, optional, tag = "3")]
pub vectors_count: ::core::option::Option<u32>,
#[prost(oneof = "vector::Vector", tags = "101, 102, 103, 104, 105, 106")]
pub vector: ::core::option::Option<vector::Vector>,
}
/// Nested message and enum types in `Vector`.
pub mod vector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Vector {
/// Dense vector
#[prost(message, tag = "101")]
Dense(super::DenseVector),
/// Sparse vector
#[prost(message, tag = "102")]
Sparse(super::SparseVector),
/// Multi dense vector
#[prost(message, tag = "103")]
MultiDense(super::MultiDenseVector),
#[prost(message, tag = "104")]
Document(super::Document),
#[prost(message, tag = "105")]
Image(super::Image),
#[prost(message, tag = "106")]
Object(super::InferenceObject),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorOutput {
/// Vector data (flatten for multi vectors), deprecated
#[deprecated]
#[prost(float, repeated, packed = "false", tag = "1")]
pub data: ::prost::alloc::vec::Vec<f32>,
/// Sparse indices for sparse vectors, deprecated
#[deprecated]
#[prost(message, optional, tag = "2")]
pub indices: ::core::option::Option<SparseIndices>,
/// Number of vectors per multi vector, deprecated
#[deprecated]
#[prost(uint32, optional, tag = "3")]
pub vectors_count: ::core::option::Option<u32>,
#[prost(oneof = "vector_output::Vector", tags = "101, 102, 103")]
pub vector: ::core::option::Option<vector_output::Vector>,
}
/// Nested message and enum types in `VectorOutput`.
pub mod vector_output {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Vector {
/// Dense vector
#[prost(message, tag = "101")]
Dense(super::DenseVector),
/// Sparse vector
#[prost(message, tag = "102")]
Sparse(super::SparseVector),
/// Multi dense vector
#[prost(message, tag = "103")]
MultiDense(super::MultiDenseVector),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DenseVector {
#[prost(float, repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<f32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SparseVector {
#[prost(float, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<f32>,
#[prost(uint32, repeated, tag = "2")]
pub indices: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiDenseVector {
#[prost(message, repeated, tag = "1")]
pub vectors: ::prost::alloc::vec::Vec<DenseVector>,
}
/// Vector type to be used in queries.
/// Ids will be substituted with their corresponding vectors from the collection.
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorInput {
#[prost(oneof = "vector_input::Variant", tags = "1, 2, 3, 4, 5, 6, 7")]
#[validate(nested)]
pub variant: ::core::option::Option<vector_input::Variant>,
}
/// Nested message and enum types in `VectorInput`.
pub mod vector_input {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
#[prost(message, tag = "1")]
Id(super::PointId),
#[prost(message, tag = "2")]
Dense(super::DenseVector),
#[prost(message, tag = "3")]
Sparse(super::SparseVector),
#[prost(message, tag = "4")]
MultiDense(super::MultiDenseVector),
#[prost(message, tag = "5")]
Document(super::Document),
#[prost(message, tag = "6")]
Image(super::Image),
#[prost(message, tag = "7")]
Object(super::InferenceObject),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShardKeySelector {
/// List of shard keys which should be used in the request
#[prost(message, repeated, tag = "1")]
pub shard_keys: ::prost::alloc::vec::Vec<ShardKey>,
#[prost(message, optional, tag = "2")]
pub fallback: ::core::option::Option<ShardKey>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpsertPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "3")]
#[validate(nested)]
pub points: ::prost::alloc::vec::Vec<PointStruct>,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "5")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Filter to apply when updating existing points. Only points matching this filter will be updated.
/// Points that don't match will keep their current state. New points will be inserted regardless of the filter.
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub update_filter: ::core::option::Option<Filter>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "7")]
pub timeout: ::core::option::Option<u64>,
/// Mode of the upsert operation: insert_only, upsert (default), update_only
#[prost(enumeration = "UpdateMode", optional, tag = "8")]
pub update_mode: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Affected points
#[prost(message, optional, tag = "3")]
pub points: ::core::option::Option<PointsSelector>,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "5")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "6")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// List of points to retrieve
#[prost(message, repeated, tag = "2")]
pub ids: ::prost::alloc::vec::Vec<PointId>,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "4")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "5")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "6")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "7")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "8")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePointVectors {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// List of points and vectors to update
#[prost(message, repeated, tag = "3")]
#[validate(nested)]
pub points: ::prost::alloc::vec::Vec<PointVectors>,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "5")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// If specified, only points that match this filter will be updated
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub update_filter: ::core::option::Option<Filter>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "7")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointVectors {
/// ID to update vectors for
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
/// Named vectors to update, leave others intact
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub vectors: ::core::option::Option<Vectors>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePointVectors {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Affected points
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub points_selector: ::core::option::Option<PointsSelector>,
/// List of vector names to delete
#[prost(message, optional, tag = "4")]
pub vectors: ::core::option::Option<VectorsSelector>,
/// Write ordering guarantees
#[prost(message, optional, tag = "5")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "6")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "7")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetPayloadPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// New payload values
#[prost(map = "string, message", tag = "3")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
/// Affected points
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub points_selector: ::core::option::Option<PointsSelector>,
/// Write ordering guarantees
#[prost(message, optional, tag = "6")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "7")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Option for indicate property of payload
#[prost(string, optional, tag = "8")]
pub key: ::core::option::Option<::prost::alloc::string::String>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "9")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePayloadPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// List of keys to delete
#[prost(string, repeated, tag = "3")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Affected points
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub points_selector: ::core::option::Option<PointsSelector>,
/// Write ordering guarantees
#[prost(message, optional, tag = "6")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "7")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "8")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearPayloadPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Affected points
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub points: ::core::option::Option<PointsSelector>,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "5")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "6")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateFieldIndexCollection {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Field name to index
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub field_name: ::prost::alloc::string::String,
/// Field type.
#[prost(enumeration = "FieldType", optional, tag = "4")]
pub field_type: ::core::option::Option<i32>,
/// Payload index params.
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub field_index_params: ::core::option::Option<PayloadIndexParams>,
/// Write ordering guarantees
#[prost(message, optional, tag = "6")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "7")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteFieldIndexCollection {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Field name to delete
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub field_name: ::prost::alloc::string::String,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "5")]
pub timeout: ::core::option::Option<u64>,
}
/// Dense vector creation parameters.
/// Only includes immutable properties that define the vector space.
/// Storage type, index, and quantization are configured separately.
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DenseVectorCreationConfig {
/// Size/dimensionality of the vectors
#[prost(uint64, tag = "1")]
#[validate(range(min = 1, max = 65536))]
pub size: u64,
/// Distance function used for comparing vectors
#[prost(enumeration = "Distance", tag = "2")]
pub distance: i32,
/// Configuration for multi-vector search (e.g., ColBERT)
#[prost(message, optional, tag = "3")]
pub multivector_config: ::core::option::Option<MultiVectorConfig>,
/// Data type of the vectors (Float32, Float16, Uint8, Turbo4)
#[prost(enumeration = "Datatype", optional, tag = "4")]
pub datatype: ::core::option::Option<i32>,
}
/// Sparse vector creation parameters.
/// Only includes immutable properties that define the vector space.
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SparseVectorCreationConfig {
/// If set - apply modifier to the vector values (e.g., IDF)
#[prost(enumeration = "Modifier", optional, tag = "1")]
pub modifier: ::core::option::Option<i32>,
/// Data type used to store weights in the index
#[prost(enumeration = "Datatype", optional, tag = "2")]
#[validate(custom(function = "crate::grpc::validate::validate_sparse_datatype"))]
pub datatype: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateVectorNameRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Name of the new vector
#[prost(string, tag = "3")]
pub vector_name: ::prost::alloc::string::String,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "6")]
pub timeout: ::core::option::Option<u64>,
/// Write ordering guarantees
#[prost(message, optional, tag = "7")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Configuration for the new vector - either dense or sparse
#[prost(oneof = "create_vector_name_request::VectorConfig", tags = "4, 5")]
#[validate(nested)]
pub vector_config: ::core::option::Option<create_vector_name_request::VectorConfig>,
}
/// Nested message and enum types in `CreateVectorNameRequest`.
pub mod create_vector_name_request {
/// Configuration for the new vector - either dense or sparse
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum VectorConfig {
/// Dense vector parameters
#[prost(message, tag = "4")]
DenseConfig(super::DenseVectorCreationConfig),
/// Sparse vector parameters
#[prost(message, tag = "5")]
SparseConfig(super::SparseVectorCreationConfig),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteVectorNameRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
/// Name of the vector to delete
#[prost(string, tag = "3")]
pub vector_name: ::prost::alloc::string::String,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "4")]
pub timeout: ::core::option::Option<u64>,
/// Write ordering guarantees
#[prost(message, optional, tag = "5")]
pub ordering: ::core::option::Option<WriteOrdering>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadIncludeSelector {
/// List of payload keys to include into result
#[prost(string, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadExcludeSelector {
/// List of payload keys to exclude from the result
#[prost(string, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WithPayloadSelector {
#[prost(oneof = "with_payload_selector::SelectorOptions", tags = "1, 2, 3")]
pub selector_options: ::core::option::Option<with_payload_selector::SelectorOptions>,
}
/// Nested message and enum types in `WithPayloadSelector`.
pub mod with_payload_selector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum SelectorOptions {
/// If `true` - return all payload, if `false` - none
#[prost(bool, tag = "1")]
Enable(bool),
#[prost(message, tag = "2")]
Include(super::PayloadIncludeSelector),
#[prost(message, tag = "3")]
Exclude(super::PayloadExcludeSelector),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedVectors {
#[prost(map = "string, message", tag = "1")]
#[validate(nested)]
pub vectors: ::std::collections::HashMap<::prost::alloc::string::String, Vector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedVectorsOutput {
#[prost(map = "string, message", tag = "1")]
pub vectors: ::std::collections::HashMap<
::prost::alloc::string::String,
VectorOutput,
>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Vectors {
#[prost(oneof = "vectors::VectorsOptions", tags = "1, 2")]
#[validate(nested)]
pub vectors_options: ::core::option::Option<vectors::VectorsOptions>,
}
/// Nested message and enum types in `Vectors`.
pub mod vectors {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VectorsOptions {
#[prost(message, tag = "1")]
Vector(super::Vector),
#[prost(message, tag = "2")]
Vectors(super::NamedVectors),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorsOutput {
#[prost(oneof = "vectors_output::VectorsOptions", tags = "1, 2")]
pub vectors_options: ::core::option::Option<vectors_output::VectorsOptions>,
}
/// Nested message and enum types in `VectorsOutput`.
pub mod vectors_output {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VectorsOptions {
#[prost(message, tag = "1")]
Vector(super::VectorOutput),
#[prost(message, tag = "2")]
Vectors(super::NamedVectorsOutput),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VectorsSelector {
/// List of vectors to include into result
#[prost(string, repeated, tag = "1")]
pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WithVectorsSelector {
#[prost(oneof = "with_vectors_selector::SelectorOptions", tags = "1, 2")]
pub selector_options: ::core::option::Option<with_vectors_selector::SelectorOptions>,
}
/// Nested message and enum types in `WithVectorsSelector`.
pub mod with_vectors_selector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum SelectorOptions {
/// If `true` - return all vectors, if `false` - none
#[prost(bool, tag = "1")]
Enable(bool),
/// List of vectors to include into result
#[prost(message, tag = "2")]
Include(super::VectorsSelector),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuantizationSearchParams {
/// If set to true, search will ignore quantized vector data
#[prost(bool, optional, tag = "1")]
pub ignore: ::core::option::Option<bool>,
/// If true, use original vectors to re-score top-k results.
/// If ignored, qdrant decides automatically does rescore enabled or not.
#[prost(bool, optional, tag = "2")]
pub rescore: ::core::option::Option<bool>,
/// Oversampling factor for quantization.
///
/// Defines how many extra vectors should be preselected using quantized index,
/// and then re-scored using original vectors.
///
/// For example, if `oversampling` is 2.4 and `limit` is 100,
/// then 240 vectors will be preselected using quantized index,
/// and then top-100 will be returned after re-scoring.
#[prost(double, optional, tag = "3")]
#[validate(range(min = 1.0))]
pub oversampling: ::core::option::Option<f64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AcornSearchParams {
/// If true, then ACORN may be used for the HNSW search based on filters
/// selectivity.
///
/// Improves search recall for searches with multiple low-selectivity
/// payload filters, at cost of performance.
#[prost(bool, optional, tag = "1")]
pub enable: ::core::option::Option<bool>,
/// Maximum selectivity of filters to enable ACORN.
///
/// If estimated filters selectivity is higher than this value,
/// ACORN will not be used. Selectivity is estimated as:
/// `estimated number of points satisfying the filters / total number of points`.
///
/// 0.0 for never, 1.0 for always. Default is 0.4.
#[prost(double, optional, tag = "2")]
#[validate(range(min = 0.0, max = 1.0))]
pub max_selectivity: ::core::option::Option<f64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SearchParams {
/// Params relevant to HNSW index. Size of the beam in a beam-search.
/// Larger the value - more accurate the result, more time required for search.
#[prost(uint64, optional, tag = "1")]
#[validate(range(min = 1))]
pub hnsw_ef: ::core::option::Option<u64>,
/// Search without approximation. If set to true, search may run long but with exact results.
#[prost(bool, optional, tag = "2")]
pub exact: ::core::option::Option<bool>,
/// If set to true, search will ignore quantized vector data
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub quantization: ::core::option::Option<QuantizationSearchParams>,
/// If enabled, the engine will only perform search among indexed or small segments.
/// Using this option prevents slow searches in case of delayed index, but does not
/// guarantee that all uploaded vectors will be included in search results
#[prost(bool, optional, tag = "4")]
pub indexed_only: ::core::option::Option<bool>,
/// ACORN search params
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub acorn: ::core::option::Option<AcornSearchParams>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// vector
#[prost(float, repeated, tag = "2")]
pub vector: ::prost::alloc::vec::Vec<f32>,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of result
#[prost(uint64, tag = "4")]
#[validate(range(min = 1))]
pub limit: u64,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Search config
#[prost(message, optional, tag = "7")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// If provided - cut off results with worse scores
#[prost(float, optional, tag = "8")]
pub score_threshold: ::core::option::Option<f32>,
/// Offset of the result
#[prost(uint64, optional, tag = "9")]
pub offset: ::core::option::Option<u64>,
/// Which vector to use for search, if not specified - use default vector
#[prost(string, optional, tag = "10")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "11")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "12")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "13")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "14")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
#[prost(message, optional, tag = "15")]
pub sparse_indices: ::core::option::Option<SparseIndices>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub search_points: ::prost::alloc::vec::Vec<SearchPoints>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "3")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WithLookup {
/// Name of the collection to use for points lookup
#[prost(string, tag = "1")]
pub collection: ::prost::alloc::string::String,
/// Options for specifying which payload to include (or not)
#[prost(message, optional, tag = "2")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Options for specifying which vectors to include (or not)
#[prost(message, optional, tag = "3")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPointGroups {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Vector to compare against
#[prost(float, repeated, tag = "2")]
pub vector: ::prost::alloc::vec::Vec<f32>,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of result
#[prost(uint32, tag = "4")]
#[validate(range(min = 1))]
pub limit: u32,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "5")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Search config
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// If provided - cut off results with worse scores
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
/// Which vector to use for search, if not specified - use default vector
#[prost(string, optional, tag = "8")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "9")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Payload field to group by, must be a string or number field.
/// If there are multiple values for the field, all of them will be used.
/// One point can be in multiple groups.
#[prost(string, tag = "10")]
#[validate(length(min = 1))]
pub group_by: ::prost::alloc::string::String,
/// Maximum amount of points to return per group
#[prost(uint32, tag = "11")]
#[validate(range(min = 1))]
pub group_size: u32,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "12")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Options for specifying how to use the group id to lookup points in another collection
#[prost(message, optional, tag = "13")]
pub with_lookup: ::core::option::Option<WithLookup>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "14")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "15")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
#[prost(message, optional, tag = "16")]
pub sparse_indices: ::core::option::Option<SparseIndices>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartFrom {
#[prost(oneof = "start_from::Value", tags = "1, 2, 3, 4")]
pub value: ::core::option::Option<start_from::Value>,
}
/// Nested message and enum types in `StartFrom`.
pub mod start_from {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(double, tag = "1")]
Float(f64),
#[prost(int64, tag = "2")]
Integer(i64),
#[prost(message, tag = "3")]
Timestamp(::prost_wkt_types::Timestamp),
#[prost(string, tag = "4")]
Datetime(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBy {
/// Payload key to order by
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
/// Ascending or descending order
#[prost(enumeration = "Direction", optional, tag = "2")]
pub direction: ::core::option::Option<i32>,
/// Start from this value
#[prost(message, optional, tag = "3")]
pub start_from: ::core::option::Option<StartFrom>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScrollPoints {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Start with this ID
#[prost(message, optional, tag = "3")]
pub offset: ::core::option::Option<PointId>,
/// Max number of result
#[prost(uint32, optional, tag = "4")]
#[validate(range(min = 1))]
pub limit: ::core::option::Option<u32>,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "7")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "8")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "9")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// Order the records by a payload field
#[prost(message, optional, tag = "10")]
pub order_by: ::core::option::Option<OrderBy>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "11")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupLocation {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
/// Which vector to use for search, if not specified - use default vector
#[prost(string, optional, tag = "2")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "3")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Look for vectors closest to the vectors from these points
#[prost(message, repeated, tag = "2")]
pub positive: ::prost::alloc::vec::Vec<PointId>,
/// Try to avoid vectors like the vector from these points
#[prost(message, repeated, tag = "3")]
pub negative: ::prost::alloc::vec::Vec<PointId>,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of result
#[prost(uint64, tag = "5")]
pub limit: u64,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "7")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Search config
#[prost(message, optional, tag = "8")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// If provided - cut off results with worse scores
#[prost(float, optional, tag = "9")]
pub score_threshold: ::core::option::Option<f32>,
/// Offset of the result
#[prost(uint64, optional, tag = "10")]
pub offset: ::core::option::Option<u64>,
/// Define which vector to use for recommendation, if not specified - default vector
#[prost(string, optional, tag = "11")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "12")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Name of the collection to use for points lookup, if not specified - use current collection
#[prost(message, optional, tag = "13")]
pub lookup_from: ::core::option::Option<LookupLocation>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "14")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// How to use the example vectors to find the results
#[prost(enumeration = "RecommendStrategy", optional, tag = "16")]
pub strategy: ::core::option::Option<i32>,
/// Look for vectors closest to those
#[prost(message, repeated, tag = "17")]
#[validate(nested)]
pub positive_vectors: ::prost::alloc::vec::Vec<Vector>,
/// Try to avoid vectors like this
#[prost(message, repeated, tag = "18")]
#[validate(nested)]
pub negative_vectors: ::prost::alloc::vec::Vec<Vector>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "19")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "20")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendBatchPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub recommend_points: ::prost::alloc::vec::Vec<RecommendPoints>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "3")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendPointGroups {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Look for vectors closest to the vectors from these points
#[prost(message, repeated, tag = "2")]
pub positive: ::prost::alloc::vec::Vec<PointId>,
/// Try to avoid vectors like the vector from these points
#[prost(message, repeated, tag = "3")]
pub negative: ::prost::alloc::vec::Vec<PointId>,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of groups in result
#[prost(uint32, tag = "5")]
#[validate(range(min = 1))]
pub limit: u32,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Search config
#[prost(message, optional, tag = "7")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// If provided - cut off results with worse scores
#[prost(float, optional, tag = "8")]
pub score_threshold: ::core::option::Option<f32>,
/// Define which vector to use for recommendation, if not specified - default vector
#[prost(string, optional, tag = "9")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "10")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Name of the collection to use for points lookup, if not specified - use current collection
#[prost(message, optional, tag = "11")]
pub lookup_from: ::core::option::Option<LookupLocation>,
/// Payload field to group by, must be a string or number field.
/// If there are multiple values for the field, all of them will be used.
/// One point can be in multiple groups.
#[prost(string, tag = "12")]
#[validate(length(min = 1))]
pub group_by: ::prost::alloc::string::String,
/// Maximum amount of points to return per group
#[prost(uint32, tag = "13")]
#[validate(range(min = 1))]
pub group_size: u32,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "14")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Options for specifying how to use the group id to lookup points in another collection
#[prost(message, optional, tag = "15")]
pub with_lookup: ::core::option::Option<WithLookup>,
/// How to use the example vectors to find the results
#[prost(enumeration = "RecommendStrategy", optional, tag = "17")]
pub strategy: ::core::option::Option<i32>,
/// Look for vectors closest to those
#[prost(message, repeated, tag = "18")]
#[validate(nested)]
pub positive_vectors: ::prost::alloc::vec::Vec<Vector>,
/// Try to avoid vectors like this
#[prost(message, repeated, tag = "19")]
#[validate(nested)]
pub negative_vectors: ::prost::alloc::vec::Vec<Vector>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "20")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "21")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetVector {
#[prost(oneof = "target_vector::Target", tags = "1")]
pub target: ::core::option::Option<target_vector::Target>,
}
/// Nested message and enum types in `TargetVector`.
pub mod target_vector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(message, tag = "1")]
Single(super::VectorExample),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VectorExample {
#[prost(oneof = "vector_example::Example", tags = "1, 2")]
pub example: ::core::option::Option<vector_example::Example>,
}
/// Nested message and enum types in `VectorExample`.
pub mod vector_example {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Example {
#[prost(message, tag = "1")]
Id(super::PointId),
#[prost(message, tag = "2")]
Vector(super::Vector),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextExamplePair {
#[prost(message, optional, tag = "1")]
pub positive: ::core::option::Option<VectorExample>,
#[prost(message, optional, tag = "2")]
pub negative: ::core::option::Option<VectorExample>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Use this as the primary search objective
#[prost(message, optional, tag = "2")]
pub target: ::core::option::Option<TargetVector>,
/// Search will be constrained by these pairs of examples
#[prost(message, repeated, tag = "3")]
pub context: ::prost::alloc::vec::Vec<ContextExamplePair>,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of result
#[prost(uint64, tag = "5")]
#[validate(range(min = 1))]
pub limit: u64,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "6")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Search config
#[prost(message, optional, tag = "7")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// Offset of the result
#[prost(uint64, optional, tag = "8")]
pub offset: ::core::option::Option<u64>,
/// Define which vector to use for recommendation, if not specified - default vector
#[prost(string, optional, tag = "9")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "10")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Name of the collection to use for points lookup, if not specified - use current collection
#[prost(message, optional, tag = "11")]
pub lookup_from: ::core::option::Option<LookupLocation>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "12")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "13")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "14")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverBatchPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub discover_points: ::prost::alloc::vec::Vec<DiscoverPoints>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "3")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Filter conditions - return only those points that satisfy the specified conditions
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// If `true` - return exact count, if `false` - return approximate count
#[prost(bool, optional, tag = "3")]
pub exact: ::core::option::Option<bool>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "4")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "5")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "6")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendInput {
/// Look for vectors closest to the vectors from these points
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub positive: ::prost::alloc::vec::Vec<VectorInput>,
/// Try to avoid vectors like the vector from these points
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub negative: ::prost::alloc::vec::Vec<VectorInput>,
/// How to use the provided vectors to find the results
#[prost(enumeration = "RecommendStrategy", optional, tag = "3")]
pub strategy: ::core::option::Option<i32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextInputPair {
/// A positive vector
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub positive: ::core::option::Option<VectorInput>,
/// Repel from this vector
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub negative: ::core::option::Option<VectorInput>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverInput {
/// Use this as the primary search objective
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub target: ::core::option::Option<VectorInput>,
/// Search space will be constrained by these pairs of vectors
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub context: ::core::option::Option<ContextInput>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextInput {
/// Search space will be constrained by these pairs of vectors
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub pairs: ::prost::alloc::vec::Vec<ContextInputPair>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelevanceFeedbackInput {
/// The original query vector
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub target: ::core::option::Option<VectorInput>,
/// Previous results scored by the feedback provider.
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub feedback: ::prost::alloc::vec::Vec<FeedbackItem>,
/// Formula and trained coefficients to use.
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub strategy: ::core::option::Option<FeedbackStrategy>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeedbackItem {
/// The id or vector from the original model
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub example: ::core::option::Option<VectorInput>,
/// Score for this vector as determined by the feedback provider
#[prost(float, tag = "2")]
pub score: f32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FeedbackStrategy {
#[prost(oneof = "feedback_strategy::Variant", tags = "1")]
#[validate(nested)]
pub variant: ::core::option::Option<feedback_strategy::Variant>,
}
/// Nested message and enum types in `FeedbackStrategy`.
pub mod feedback_strategy {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Variant {
/// a * score + sim(confidence^b * c * delta)
#[prost(message, tag = "1")]
Naive(super::NaiveFeedbackStrategy),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NaiveFeedbackStrategy {
#[prost(float, tag = "1")]
pub a: f32,
#[prost(float, tag = "2")]
#[validate(range(min = 0.0))]
pub b: f32,
#[prost(float, tag = "3")]
pub c: f32,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Formula {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub expression: ::core::option::Option<Expression>,
#[prost(map = "string, message", tag = "2")]
pub defaults: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expression {
#[prost(
oneof = "expression::Variant",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19"
)]
#[validate(nested)]
pub variant: ::core::option::Option<expression::Variant>,
}
/// Nested message and enum types in `Expression`.
pub mod expression {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
#[prost(float, tag = "1")]
Constant(f32),
/// Payload key or reference to score.
#[prost(string, tag = "2")]
Variable(::prost::alloc::string::String),
/// Payload condition. If true, becomes 1.0; otherwise 0.0
#[prost(message, tag = "3")]
Condition(super::Condition),
/// Geographic distance in meters
#[prost(message, tag = "4")]
GeoDistance(super::GeoDistance),
/// Date-time constant
#[prost(string, tag = "5")]
Datetime(::prost::alloc::string::String),
/// Payload key with date-time values
#[prost(string, tag = "6")]
DatetimeKey(::prost::alloc::string::String),
/// Multiply
#[prost(message, tag = "7")]
Mult(super::MultExpression),
/// Sum
#[prost(message, tag = "8")]
Sum(super::SumExpression),
/// Divide
#[prost(message, tag = "9")]
Div(::prost::alloc::boxed::Box<super::DivExpression>),
/// Negate
#[prost(message, tag = "10")]
Neg(::prost::alloc::boxed::Box<super::Expression>),
/// Absolute value
#[prost(message, tag = "11")]
Abs(::prost::alloc::boxed::Box<super::Expression>),
/// Square root
#[prost(message, tag = "12")]
Sqrt(::prost::alloc::boxed::Box<super::Expression>),
/// Power
#[prost(message, tag = "13")]
Pow(::prost::alloc::boxed::Box<super::PowExpression>),
/// Exponential
#[prost(message, tag = "14")]
Exp(::prost::alloc::boxed::Box<super::Expression>),
/// Logarithm
#[prost(message, tag = "15")]
Log10(::prost::alloc::boxed::Box<super::Expression>),
/// Natural logarithm
#[prost(message, tag = "16")]
Ln(::prost::alloc::boxed::Box<super::Expression>),
/// Exponential decay
#[prost(message, tag = "17")]
ExpDecay(::prost::alloc::boxed::Box<super::DecayParamsExpression>),
/// Gaussian decay
#[prost(message, tag = "18")]
GaussDecay(::prost::alloc::boxed::Box<super::DecayParamsExpression>),
/// Linear decay
#[prost(message, tag = "19")]
LinDecay(::prost::alloc::boxed::Box<super::DecayParamsExpression>),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoDistance {
#[prost(message, optional, tag = "1")]
pub origin: ::core::option::Option<GeoPoint>,
#[prost(string, tag = "2")]
pub to: ::prost::alloc::string::String,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultExpression {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub mult: ::prost::alloc::vec::Vec<Expression>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SumExpression {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub sum: ::prost::alloc::vec::Vec<Expression>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DivExpression {
#[prost(message, optional, boxed, tag = "1")]
#[validate(nested)]
pub left: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
#[prost(message, optional, boxed, tag = "2")]
#[validate(nested)]
pub right: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
#[prost(float, optional, tag = "3")]
pub by_zero_default: ::core::option::Option<f32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PowExpression {
#[prost(message, optional, boxed, tag = "1")]
#[validate(nested)]
pub base: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
#[prost(message, optional, boxed, tag = "2")]
#[validate(nested)]
pub exponent: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecayParamsExpression {
/// The variable to decay
#[prost(message, optional, boxed, tag = "1")]
#[validate(nested)]
pub x: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
/// The target value to start decaying from. Defaults to 0.
#[prost(message, optional, boxed, tag = "2")]
#[validate(nested)]
pub target: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
/// The scale factor of the decay, in terms of `x`.
/// Defaults to 1.0. Must be a non-zero positive number.
#[prost(float, optional, tag = "3")]
pub scale: ::core::option::Option<f32>,
/// The midpoint of the decay.
/// Should be between 0 and 1. Defaults to 0.5.
/// Output will be this value when `|x - target| == scale`.
#[prost(float, optional, tag = "4")]
pub midpoint: ::core::option::Option<f32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NearestInputWithMmr {
/// The vector to search for nearest neighbors.
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub nearest: ::core::option::Option<VectorInput>,
/// Perform MMR (Maximal Marginal Relevance) reranking after search,
/// using the same vector in this query to calculate relevance.
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub mmr: ::core::option::Option<Mmr>,
}
/// Maximal Marginal Relevance (MMR) algorithm for re-ranking the points.
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Mmr {
/// Tunable parameter for the MMR algorithm.
/// Determines the balance between diversity and relevance.
///
/// A higher value favors diversity (dissimilarity to selected results),
/// while a lower value favors relevance (similarity to the query vector).
///
/// Must be in the range \[0, 1\].
/// Default value is 0.5.
#[prost(float, optional, tag = "2")]
#[validate(range(min = 0.0, max = 1.0))]
pub diversity: ::core::option::Option<f32>,
/// The maximum number of candidates to consider for re-ranking.
///
/// If not specified, the `limit` value is used.
#[prost(uint32, optional, tag = "3")]
#[validate(range(max = 16_384))]
pub candidates_limit: ::core::option::Option<u32>,
}
/// Parameterized reciprocal rank fusion
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rrf {
/// K parameter for reciprocal rank fusion
#[prost(uint32, optional, tag = "1")]
#[validate(range(min = 1))]
pub k: ::core::option::Option<u32>,
/// Weights for each prefetch source.
/// Higher weight gives more influence on the final ranking.
/// If not specified, all prefetches are weighted equally.
/// The number of weights should match the number of prefetches.
#[prost(float, repeated, tag = "2")]
pub weights: ::prost::alloc::vec::Vec<f32>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Query {
#[prost(oneof = "query::Variant", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11")]
#[validate(nested)]
pub variant: ::core::option::Option<query::Variant>,
}
/// Nested message and enum types in `Query`.
pub mod query {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
/// Find the nearest neighbors to this vector.
#[prost(message, tag = "1")]
Nearest(super::VectorInput),
/// Use multiple positive and negative vectors to find the results.
#[prost(message, tag = "2")]
Recommend(super::RecommendInput),
/// Search for nearest points, but constrain the search space with context
#[prost(message, tag = "3")]
Discover(super::DiscoverInput),
/// Return points that live in positive areas.
#[prost(message, tag = "4")]
Context(super::ContextInput),
/// Order the points by a payload field.
#[prost(message, tag = "5")]
OrderBy(super::OrderBy),
/// Fuse the results of multiple prefetches.
#[prost(enumeration = "super::Fusion", tag = "6")]
Fusion(i32),
/// Sample points from the collection.
#[prost(enumeration = "super::Sample", tag = "7")]
Sample(i32),
/// Score boosting via an arbitrary formula
#[prost(message, tag = "8")]
Formula(super::Formula),
/// Search nearest neighbors, but re-rank based on the Maximal Marginal Relevance algorithm.
#[prost(message, tag = "9")]
NearestWithMmr(super::NearestInputWithMmr),
/// Parameterized reciprocal rank fusion
#[prost(message, tag = "10")]
Rrf(super::Rrf),
/// Search with feedback from some oracle.
#[prost(message, tag = "11")]
RelevanceFeedback(super::RelevanceFeedbackInput),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrefetchQuery {
/// Sub-requests to perform first.
/// If present, the query will be performed on the results of the prefetches.
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub prefetch: ::prost::alloc::vec::Vec<PrefetchQuery>,
/// Query to perform.
/// If missing, returns points ordered by their IDs.
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub query: ::core::option::Option<Query>,
/// Define which vector to use for querying.
/// If missing, the default vector is used.
#[prost(string, optional, tag = "3")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Filter conditions - return only those points that satisfy the specified conditions.
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Search params for when there is no prefetch.
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// Return points with scores better than this threshold.
#[prost(float, optional, tag = "6")]
pub score_threshold: ::core::option::Option<f32>,
/// Max number of points. Default is 10
#[prost(uint64, optional, tag = "7")]
#[validate(range(min = 1))]
pub limit: ::core::option::Option<u64>,
/// The location to use for IDs lookup.
/// If not specified - use the current collection and the 'using' vector.
#[prost(message, optional, tag = "8")]
pub lookup_from: ::core::option::Option<LookupLocation>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Sub-requests to perform first.
/// If present, the query will be performed on the results of the prefetches.
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub prefetch: ::prost::alloc::vec::Vec<PrefetchQuery>,
/// Query to perform. If missing, returns points ordered by their IDs.
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub query: ::core::option::Option<Query>,
/// Define which vector to use for querying.
/// If missing, the default vector is used.
#[prost(string, optional, tag = "4")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Filter conditions - return only those points that satisfy the specified conditions.
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Search params for when there is no prefetch.
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// Return points with scores better than this threshold.
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
/// Max number of points. Default is 10.
#[prost(uint64, optional, tag = "8")]
#[validate(range(min = 1))]
pub limit: ::core::option::Option<u64>,
/// Offset of the result. Skip this many points. Default is 0.
#[prost(uint64, optional, tag = "9")]
pub offset: ::core::option::Option<u64>,
/// Options for specifying which vectors to include into the response.
#[prost(message, optional, tag = "10")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// Options for specifying which payload to include or not.
#[prost(message, optional, tag = "11")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Options for specifying read consistency guarantees.
#[prost(message, optional, tag = "12")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points.
/// If not specified - look in all shards.
#[prost(message, optional, tag = "13")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
/// The location to use for IDs lookup.
/// If not specified - use the current collection and the 'using' vector.
#[prost(message, optional, tag = "14")]
pub lookup_from: ::core::option::Option<LookupLocation>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "15")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBatchPoints {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub query_points: ::prost::alloc::vec::Vec<QueryPoints>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "3")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryPointGroups {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Sub-requests to perform first.
/// If present, the query will be performed on the results of the prefetches.
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub prefetch: ::prost::alloc::vec::Vec<PrefetchQuery>,
/// Query to perform. If missing, returns points ordered by their IDs.
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub query: ::core::option::Option<Query>,
/// Define which vector to use for querying.
/// If missing, the default vector is used.
#[prost(string, optional, tag = "4")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// Filter conditions - return only those points that satisfy the specified conditions.
#[prost(message, optional, tag = "5")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Search params for when there is no prefetch.
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
/// Return points with scores better than this threshold.
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
/// Options for specifying which payload to include or not
#[prost(message, optional, tag = "8")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
/// Options for specifying which vectors to include into response
#[prost(message, optional, tag = "9")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
/// The location to use for IDs lookup.
/// If not specified - use the current collection and the 'using' vector.
#[prost(message, optional, tag = "10")]
pub lookup_from: ::core::option::Option<LookupLocation>,
/// Max number of points. Default is 3.
#[prost(uint64, optional, tag = "11")]
#[validate(range(min = 1))]
pub limit: ::core::option::Option<u64>,
/// Maximum amount of points to return per group. Defaults to 10.
#[prost(uint64, optional, tag = "12")]
#[validate(range(min = 1))]
pub group_size: ::core::option::Option<u64>,
/// Payload field to group by, must be a string or number field.
/// If there are multiple values for the field, all of them will be used.
/// One point can be in multiple groups.
#[prost(string, tag = "13")]
#[validate(length(min = 1))]
pub group_by: ::prost::alloc::string::String,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "14")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Options for specifying how to use the group id to lookup points in another collection
#[prost(message, optional, tag = "15")]
pub with_lookup: ::core::option::Option<WithLookup>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "16")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "17")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FacetCounts {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Payload key of the facet
#[prost(string, tag = "2")]
#[validate(length(min = 1))]
pub key: ::prost::alloc::string::String,
/// Filter conditions - return only those points that satisfy the specified conditions.
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// Max number of facets. Default is 10.
#[prost(uint64, optional, tag = "4")]
pub limit: ::core::option::Option<u64>,
/// If true, return exact counts, slower but useful for debugging purposes. Default is false.
#[prost(bool, optional, tag = "5")]
pub exact: ::core::option::Option<bool>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "6")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "7")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "8")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FacetValue {
#[prost(oneof = "facet_value::Variant", tags = "1, 2, 3")]
pub variant: ::core::option::Option<facet_value::Variant>,
}
/// Nested message and enum types in `FacetValue`.
pub mod facet_value {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
/// String value from the facet
#[prost(string, tag = "1")]
StringValue(::prost::alloc::string::String),
/// Integer value from the facet
#[prost(int64, tag = "2")]
IntegerValue(i64),
/// Boolean value from the facet
#[prost(bool, tag = "3")]
BoolValue(bool),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FacetHit {
/// Value from the facet
#[prost(message, optional, tag = "1")]
pub value: ::core::option::Option<FacetValue>,
/// Number of points with this value
#[prost(uint64, tag = "2")]
pub count: u64,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixPoints {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Filter conditions - return only those points that satisfy the specified conditions.
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
/// How many points to select and search within. Default is 10.
#[prost(uint64, optional, tag = "3")]
#[validate(range(min = 2))]
pub sample: ::core::option::Option<u64>,
/// How many neighbours per sample to find. Default is 3.
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub limit: ::core::option::Option<u64>,
/// Define which vector to use for querying. If missing, the default vector is used.
#[prost(string, optional, tag = "5")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
/// If set, overrides global timeout setting for this request. Unit is seconds.
#[prost(uint64, optional, tag = "6")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
/// Options for specifying read consistency guarantees
#[prost(message, optional, tag = "7")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
/// Specify in which shards to look for the points, if not specified - look in all shards
#[prost(message, optional, tag = "8")]
pub shard_key_selector: ::core::option::Option<ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixPairs {
/// List of pairs of points with scores
#[prost(message, repeated, tag = "1")]
pub pairs: ::prost::alloc::vec::Vec<SearchMatrixPair>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixPair {
/// first id of the pair
#[prost(message, optional, tag = "1")]
pub a: ::core::option::Option<PointId>,
/// second id of the pair
#[prost(message, optional, tag = "2")]
pub b: ::core::option::Option<PointId>,
/// score of the pair
#[prost(float, tag = "3")]
pub score: f32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixOffsets {
/// Row indices of the matrix
#[prost(uint64, repeated, tag = "1")]
pub offsets_row: ::prost::alloc::vec::Vec<u64>,
/// Column indices of the matrix
#[prost(uint64, repeated, tag = "2")]
pub offsets_col: ::prost::alloc::vec::Vec<u64>,
/// Scores associated with matrix coordinates
#[prost(float, repeated, tag = "3")]
pub scores: ::prost::alloc::vec::Vec<f32>,
/// Ids of the points in order
#[prost(message, repeated, tag = "4")]
pub ids: ::prost::alloc::vec::Vec<PointId>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsUpdateOperation {
#[prost(
oneof = "points_update_operation::Operation",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
)]
pub operation: ::core::option::Option<points_update_operation::Operation>,
}
/// Nested message and enum types in `PointsUpdateOperation`.
pub mod points_update_operation {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointStructList {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<super::PointStruct>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "2")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
/// Filter to apply when updating existing points. Only points matching this filter will be updated.
/// Points that don't match will keep their current state. New points will be inserted regardless of the filter.
#[prost(message, optional, tag = "3")]
pub update_filter: ::core::option::Option<super::Filter>,
/// Mode of the upsert operation: insert_only, upsert (default), update_only
#[prost(enumeration = "super::UpdateMode", optional, tag = "4")]
pub update_mode: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetPayload {
#[prost(map = "string, message", tag = "1")]
pub payload: ::std::collections::HashMap<
::prost::alloc::string::String,
super::Value,
>,
/// Affected points
#[prost(message, optional, tag = "2")]
pub points_selector: ::core::option::Option<super::PointsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "3")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
/// Option for indicate property of payload
#[prost(string, optional, tag = "4")]
pub key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OverwritePayload {
#[prost(map = "string, message", tag = "1")]
pub payload: ::std::collections::HashMap<
::prost::alloc::string::String,
super::Value,
>,
/// Affected points
#[prost(message, optional, tag = "2")]
pub points_selector: ::core::option::Option<super::PointsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "3")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
/// Option for indicate property of payload
#[prost(string, optional, tag = "4")]
pub key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePayload {
#[prost(string, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Affected points
#[prost(message, optional, tag = "2")]
pub points_selector: ::core::option::Option<super::PointsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "3")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateVectors {
/// List of points and vectors to update
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<super::PointVectors>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "2")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
/// If specified, only points that match this filter will be updated
#[prost(message, optional, tag = "3")]
pub update_filter: ::core::option::Option<super::Filter>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteVectors {
/// Affected points
#[prost(message, optional, tag = "1")]
pub points_selector: ::core::option::Option<super::PointsSelector>,
/// List of vector names to delete
#[prost(message, optional, tag = "2")]
pub vectors: ::core::option::Option<super::VectorsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "3")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePoints {
/// Affected points
#[prost(message, optional, tag = "1")]
pub points: ::core::option::Option<super::PointsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "2")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearPayload {
/// Affected points
#[prost(message, optional, tag = "1")]
pub points: ::core::option::Option<super::PointsSelector>,
/// Option for custom sharding to specify used shard keys
#[prost(message, optional, tag = "2")]
pub shard_key_selector: ::core::option::Option<super::ShardKeySelector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Operation {
#[prost(message, tag = "1")]
Upsert(PointStructList),
#[deprecated]
#[prost(message, tag = "2")]
DeleteDeprecated(super::PointsSelector),
#[prost(message, tag = "3")]
SetPayload(SetPayload),
#[prost(message, tag = "4")]
OverwritePayload(OverwritePayload),
#[prost(message, tag = "5")]
DeletePayload(DeletePayload),
#[deprecated]
#[prost(message, tag = "6")]
ClearPayloadDeprecated(super::PointsSelector),
#[prost(message, tag = "7")]
UpdateVectors(UpdateVectors),
#[prost(message, tag = "8")]
DeleteVectors(DeleteVectors),
#[prost(message, tag = "9")]
DeletePoints(DeletePoints),
#[prost(message, tag = "10")]
ClearPayload(ClearPayload),
}
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBatchPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "3")]
#[validate(length(min = 1))]
pub operations: ::prost::alloc::vec::Vec<PointsUpdateOperation>,
/// Write ordering guarantees
#[prost(message, optional, tag = "4")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Timeout for the operation in seconds
#[prost(uint64, optional, tag = "5")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsOperationResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<UpdateResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateResult {
/// Number of operation
#[prost(uint64, optional, tag = "1")]
pub operation_id: ::core::option::Option<u64>,
/// Operation status
#[prost(enumeration = "UpdateStatus", tag = "2")]
pub status: i32,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OrderValue {
#[prost(oneof = "order_value::Variant", tags = "1, 2")]
pub variant: ::core::option::Option<order_value::Variant>,
}
/// Nested message and enum types in `OrderValue`.
pub mod order_value {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Variant {
#[prost(int64, tag = "1")]
Int(i64),
#[prost(double, tag = "2")]
Float(f64),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScoredPoint {
/// Point id
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
/// Payload
#[prost(map = "string, message", tag = "2")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
/// Similarity score
#[prost(float, tag = "3")]
pub score: f32,
/// Last update operation applied to this point
#[prost(uint64, tag = "5")]
pub version: u64,
/// Vectors to search
#[prost(message, optional, tag = "6")]
pub vectors: ::core::option::Option<VectorsOutput>,
/// Shard key
#[prost(message, optional, tag = "7")]
pub shard_key: ::core::option::Option<ShardKey>,
/// Order by value
#[prost(message, optional, tag = "8")]
pub order_value: ::core::option::Option<OrderValue>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GroupId {
#[prost(oneof = "group_id::Kind", tags = "1, 2, 3")]
pub kind: ::core::option::Option<group_id::Kind>,
}
/// Nested message and enum types in `GroupId`.
pub mod group_id {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Kind {
/// Represents an unsigned integer value.
#[prost(uint64, tag = "1")]
UnsignedValue(u64),
/// Represents an integer value
#[prost(int64, tag = "2")]
IntegerValue(i64),
/// Represents a string value.
#[prost(string, tag = "3")]
StringValue(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointGroup {
/// Group id
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<GroupId>,
/// Points in the group
#[prost(message, repeated, tag = "2")]
pub hits: ::prost::alloc::vec::Vec<ScoredPoint>,
/// Point(s) from the lookup collection that matches the group id
#[prost(message, optional, tag = "3")]
pub lookup: ::core::option::Option<RetrievedPoint>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupsResult {
/// Groups
#[prost(message, repeated, tag = "1")]
pub groups: ::prost::alloc::vec::Vec<PointGroup>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGroupsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<GroupsResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchResult {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchGroupsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<GroupsResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<CountResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScrollResponse {
/// Use this offset for the next query
#[prost(message, optional, tag = "1")]
pub next_page_offset: ::core::option::Option<PointId>,
#[prost(message, repeated, tag = "2")]
pub result: ::prost::alloc::vec::Vec<RetrievedPoint>,
/// Time spent to process
#[prost(double, tag = "3")]
pub time: f64,
#[prost(message, optional, tag = "4")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CountResult {
#[prost(uint64, tag = "1")]
pub count: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrievedPoint {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
#[prost(map = "string, message", tag = "2")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(message, optional, tag = "4")]
pub vectors: ::core::option::Option<VectorsOutput>,
/// Shard key
#[prost(message, optional, tag = "5")]
pub shard_key: ::core::option::Option<ShardKey>,
/// Order-by value
#[prost(message, optional, tag = "6")]
pub order_value: ::core::option::Option<OrderValue>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<RetrievedPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoverBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<BatchResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendGroupsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<GroupsResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBatchResponse {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<UpdateResult>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FacetResponse {
#[prost(message, repeated, tag = "1")]
pub hits: ::prost::alloc::vec::Vec<FacetHit>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixPairsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<SearchMatrixPairs>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMatrixOffsetsResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<SearchMatrixOffsets>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<Usage>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsSelector {
#[prost(oneof = "points_selector::PointsSelectorOneOf", tags = "1, 2")]
#[validate(nested)]
pub points_selector_one_of: ::core::option::Option<
points_selector::PointsSelectorOneOf,
>,
}
/// Nested message and enum types in `PointsSelector`.
pub mod points_selector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PointsSelectorOneOf {
#[prost(message, tag = "1")]
Points(super::PointsIdsList),
#[prost(message, tag = "2")]
Filter(super::Filter),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsIdsList {
#[prost(message, repeated, tag = "1")]
pub ids: ::prost::alloc::vec::Vec<PointId>,
}
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointStruct {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<PointId>,
#[prost(map = "string, message", tag = "3")]
pub payload: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
#[prost(message, optional, tag = "4")]
#[validate(nested)]
pub vectors: ::core::option::Option<Vectors>,
}
/// ---
///
/// ## ----------- Measurements collector ----------
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Usage {
#[prost(message, optional, tag = "1")]
pub hardware: ::core::option::Option<HardwareUsage>,
#[prost(message, optional, tag = "2")]
pub inference: ::core::option::Option<InferenceUsage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InferenceUsage {
#[prost(map = "string, message", tag = "1")]
pub models: ::std::collections::HashMap<::prost::alloc::string::String, ModelUsage>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelUsage {
#[prost(uint64, tag = "1")]
pub tokens: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HardwareUsage {
#[prost(uint64, tag = "1")]
pub cpu: u64,
#[prost(uint64, tag = "2")]
pub payload_io_read: u64,
#[prost(uint64, tag = "3")]
pub payload_io_write: u64,
#[prost(uint64, tag = "4")]
pub payload_index_io_read: u64,
#[prost(uint64, tag = "5")]
pub payload_index_io_write: u64,
#[prost(uint64, tag = "6")]
pub vector_io_read: u64,
#[prost(uint64, tag = "7")]
pub vector_io_write: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WriteOrderingType {
/// Write operations may be reordered, works faster, default
Weak = 0,
/// Write operations go through dynamically selected leader,
/// may be inconsistent for a short period of time in case of leader change
Medium = 1,
/// Write operations go through the permanent leader, consistent,
/// but may be unavailable if leader is down
Strong = 2,
}
impl WriteOrderingType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Weak => "Weak",
Self::Medium => "Medium",
Self::Strong => "Strong",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Weak" => Some(Self::Weak),
"Medium" => Some(Self::Medium),
"Strong" => Some(Self::Strong),
_ => None,
}
}
}
/// Defines the mode of the upsert operation
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UpdateMode {
/// Default mode - insert new points, update existing points
Upsert = 0,
/// Only insert new points, do not update existing points
InsertOnly = 1,
/// Only update existing points, do not insert new points
UpdateOnly = 2,
}
impl UpdateMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Upsert => "Upsert",
Self::InsertOnly => "InsertOnly",
Self::UpdateOnly => "UpdateOnly",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Upsert" => Some(Self::Upsert),
"InsertOnly" => Some(Self::InsertOnly),
"UpdateOnly" => Some(Self::UpdateOnly),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReadConsistencyType {
/// Send request to all nodes and return points which are present on all of them
All = 0,
/// Send requests to all nodes and return points which are present on majority of them
Majority = 1,
/// Send requests to half + 1 nodes, return points which are present on all of them
Quorum = 2,
}
impl ReadConsistencyType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::All => "All",
Self::Majority => "Majority",
Self::Quorum => "Quorum",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"All" => Some(Self::All),
"Majority" => Some(Self::Majority),
"Quorum" => Some(Self::Quorum),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FieldType {
Keyword = 0,
Integer = 1,
Float = 2,
Geo = 3,
Text = 4,
Bool = 5,
Datetime = 6,
Uuid = 7,
}
impl FieldType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Keyword => "FieldTypeKeyword",
Self::Integer => "FieldTypeInteger",
Self::Float => "FieldTypeFloat",
Self::Geo => "FieldTypeGeo",
Self::Text => "FieldTypeText",
Self::Bool => "FieldTypeBool",
Self::Datetime => "FieldTypeDatetime",
Self::Uuid => "FieldTypeUuid",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FieldTypeKeyword" => Some(Self::Keyword),
"FieldTypeInteger" => Some(Self::Integer),
"FieldTypeFloat" => Some(Self::Float),
"FieldTypeGeo" => Some(Self::Geo),
"FieldTypeText" => Some(Self::Text),
"FieldTypeBool" => Some(Self::Bool),
"FieldTypeDatetime" => Some(Self::Datetime),
"FieldTypeUuid" => Some(Self::Uuid),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Direction {
Asc = 0,
Desc = 1,
}
impl Direction {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Asc => "Asc",
Self::Desc => "Desc",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Asc" => Some(Self::Asc),
"Desc" => Some(Self::Desc),
_ => None,
}
}
}
/// How to use positive and negative vectors to find the results, default is `AverageVector`.
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RecommendStrategy {
/// Average positive and negative vectors and create a single query with the formula
/// `query = avg_pos + avg_pos - avg_neg`. Then performs normal search.
AverageVector = 0,
/// Uses custom search objective. Each candidate is compared against all
/// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
/// If the `max_neg_score` is chosen then it is squared and negated.
BestScore = 1,
/// Uses custom search objective. Compares against all inputs, sums all the scores.
/// Scores against positive vectors are added, against negatives are subtracted.
SumScores = 2,
}
impl RecommendStrategy {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AverageVector => "AverageVector",
Self::BestScore => "BestScore",
Self::SumScores => "SumScores",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AverageVector" => Some(Self::AverageVector),
"BestScore" => Some(Self::BestScore),
"SumScores" => Some(Self::SumScores),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Fusion {
/// Reciprocal Rank Fusion (with default parameters)
Rrf = 0,
/// Distribution-Based Score Fusion
Dbsf = 1,
}
impl Fusion {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Rrf => "RRF",
Self::Dbsf => "DBSF",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RRF" => Some(Self::Rrf),
"DBSF" => Some(Self::Dbsf),
_ => None,
}
}
}
/// Sample points from the collection
///
/// Available sampling methods:
///
/// * `random` - Random sampling
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Sample {
Random = 0,
}
impl Sample {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Random => "Random",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Random" => Some(Self::Random),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UpdateStatus {
UnknownUpdateStatus = 0,
/// Update is received, but not processed yet
Acknowledged = 1,
/// Update is applied and ready for search
Completed = 2,
/// Internal: update is rejected due to an outdated clock
ClockRejected = 3,
/// Timeout of awaited operations
WaitTimeout = 4,
}
impl UpdateStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownUpdateStatus => "UnknownUpdateStatus",
Self::Acknowledged => "Acknowledged",
Self::Completed => "Completed",
Self::ClockRejected => "ClockRejected",
Self::WaitTimeout => "WaitTimeout",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnknownUpdateStatus" => Some(Self::UnknownUpdateStatus),
"Acknowledged" => Some(Self::Acknowledged),
"Completed" => Some(Self::Completed),
"ClockRejected" => Some(Self::ClockRejected),
"WaitTimeout" => Some(Self::WaitTimeout),
_ => None,
}
}
}
/// Generated client implementations.
pub mod points_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 PointsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PointsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> PointsClient<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,
) -> PointsClient<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,
{
PointsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Perform insert + updates on points.
/// If a point with a given ID already exists - it will be overwritten.
pub async fn upsert(
&mut self,
request: impl tonic::IntoRequest<super::UpsertPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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("/qdrant.Points/Upsert");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Upsert"));
self.inner.unary(req, path, codec).await
}
/// Delete points
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeletePoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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("/qdrant.Points/Delete");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Delete"));
self.inner.unary(req, path, codec).await
}
/// Retrieve points
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetPoints>,
) -> std::result::Result<tonic::Response<super::GetResponse>, 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("/qdrant.Points/Get");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Get"));
self.inner.unary(req, path, codec).await
}
/// Update named vectors for point
pub async fn update_vectors(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePointVectors>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/UpdateVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "UpdateVectors"));
self.inner.unary(req, path, codec).await
}
/// Delete named vectors for points
pub async fn delete_vectors(
&mut self,
request: impl tonic::IntoRequest<super::DeletePointVectors>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/DeleteVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "DeleteVectors"));
self.inner.unary(req, path, codec).await
}
/// Set payload for points
pub async fn set_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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("/qdrant.Points/SetPayload");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "SetPayload"));
self.inner.unary(req, path, codec).await
}
/// Overwrite payload for points
pub async fn overwrite_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/OverwritePayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "OverwritePayload"));
self.inner.unary(req, path, codec).await
}
/// Delete specified key payload for points
pub async fn delete_payload(
&mut self,
request: impl tonic::IntoRequest<super::DeletePayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/DeletePayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "DeletePayload"));
self.inner.unary(req, path, codec).await
}
/// Remove all payload for specified points
pub async fn clear_payload(
&mut self,
request: impl tonic::IntoRequest<super::ClearPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/ClearPayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "ClearPayload"));
self.inner.unary(req, path, codec).await
}
/// Create index for field in collection
pub async fn create_field_index(
&mut self,
request: impl tonic::IntoRequest<super::CreateFieldIndexCollection>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/CreateFieldIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "CreateFieldIndex"));
self.inner.unary(req, path, codec).await
}
/// Delete field index for collection
pub async fn delete_field_index(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFieldIndexCollection>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/DeleteFieldIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "DeleteFieldIndex"));
self.inner.unary(req, path, codec).await
}
/// Create a new named vector on the collection
pub async fn create_vector_name(
&mut self,
request: impl tonic::IntoRequest<super::CreateVectorNameRequest>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/CreateVectorName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "CreateVectorName"));
self.inner.unary(req, path, codec).await
}
/// Delete a named vector from the collection
pub async fn delete_vector_name(
&mut self,
request: impl tonic::IntoRequest<super::DeleteVectorNameRequest>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
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(
"/qdrant.Points/DeleteVectorName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "DeleteVectorName"));
self.inner.unary(req, path, codec).await
}
/// Retrieve closest points based on vector similarity and given filtering
/// conditions
pub async fn search(
&mut self,
request: impl tonic::IntoRequest<super::SearchPoints>,
) -> std::result::Result<tonic::Response<super::SearchResponse>, 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("/qdrant.Points/Search");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Search"));
self.inner.unary(req, path, codec).await
}
/// Retrieve closest points based on vector similarity and given filtering
/// conditions
pub async fn search_batch(
&mut self,
request: impl tonic::IntoRequest<super::SearchBatchPoints>,
) -> std::result::Result<
tonic::Response<super::SearchBatchResponse>,
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(
"/qdrant.Points/SearchBatch",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "SearchBatch"));
self.inner.unary(req, path, codec).await
}
/// Retrieve closest points based on vector similarity and given filtering
/// conditions, grouped by a given field
pub async fn search_groups(
&mut self,
request: impl tonic::IntoRequest<super::SearchPointGroups>,
) -> std::result::Result<
tonic::Response<super::SearchGroupsResponse>,
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(
"/qdrant.Points/SearchGroups",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "SearchGroups"));
self.inner.unary(req, path, codec).await
}
/// Iterate over all or filtered points
pub async fn scroll(
&mut self,
request: impl tonic::IntoRequest<super::ScrollPoints>,
) -> std::result::Result<tonic::Response<super::ScrollResponse>, 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("/qdrant.Points/Scroll");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Scroll"));
self.inner.unary(req, path, codec).await
}
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples.
pub async fn recommend(
&mut self,
request: impl tonic::IntoRequest<super::RecommendPoints>,
) -> std::result::Result<
tonic::Response<super::RecommendResponse>,
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("/qdrant.Points/Recommend");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Recommend"));
self.inner.unary(req, path, codec).await
}
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples.
pub async fn recommend_batch(
&mut self,
request: impl tonic::IntoRequest<super::RecommendBatchPoints>,
) -> std::result::Result<
tonic::Response<super::RecommendBatchResponse>,
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(
"/qdrant.Points/RecommendBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "RecommendBatch"));
self.inner.unary(req, path, codec).await
}
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples, grouped by a given field
pub async fn recommend_groups(
&mut self,
request: impl tonic::IntoRequest<super::RecommendPointGroups>,
) -> std::result::Result<
tonic::Response<super::RecommendGroupsResponse>,
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(
"/qdrant.Points/RecommendGroups",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "RecommendGroups"));
self.inner.unary(req, path, codec).await
}
/// Use context and a target to find the most similar points to the target,
/// constrained by the context.
///
/// When using only the context (without a target), a special search - called
/// context search - is performed where pairs of points are used to generate a
/// loss that guides the search towards the zone where most positive examples
/// overlap. This means that the score minimizes the scenario of finding a
/// point closer to a negative than to a positive part of a pair.
///
/// Since the score of a context relates to loss, the maximum score a point
/// can get is 0.0, and it becomes normal that many points can have a score of
/// 0.0.
///
/// When using target (with or without context), the score behaves a little
/// different: The integer part of the score represents the rank with respect
/// to the context, while the decimal part of the score relates to the
/// distance to the target. The context part of the score for each pair is
/// calculated +1 if the point is closer to a positive than to a negative part
/// of a pair, and -1 otherwise.
pub async fn discover(
&mut self,
request: impl tonic::IntoRequest<super::DiscoverPoints>,
) -> std::result::Result<
tonic::Response<super::DiscoverResponse>,
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("/qdrant.Points/Discover");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Discover"));
self.inner.unary(req, path, codec).await
}
/// Batch request points based on { positive, negative } pairs of examples, and/or a target
pub async fn discover_batch(
&mut self,
request: impl tonic::IntoRequest<super::DiscoverBatchPoints>,
) -> std::result::Result<
tonic::Response<super::DiscoverBatchResponse>,
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(
"/qdrant.Points/DiscoverBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "DiscoverBatch"));
self.inner.unary(req, path, codec).await
}
/// Count points in collection with given filtering conditions
pub async fn count(
&mut self,
request: impl tonic::IntoRequest<super::CountPoints>,
) -> std::result::Result<tonic::Response<super::CountResponse>, 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("/qdrant.Points/Count");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Count"));
self.inner.unary(req, path, codec).await
}
/// Perform multiple update operations in one request
pub async fn update_batch(
&mut self,
request: impl tonic::IntoRequest<super::UpdateBatchPoints>,
) -> std::result::Result<
tonic::Response<super::UpdateBatchResponse>,
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(
"/qdrant.Points/UpdateBatch",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "UpdateBatch"));
self.inner.unary(req, path, codec).await
}
/// Universally query points.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
pub async fn query(
&mut self,
request: impl tonic::IntoRequest<super::QueryPoints>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, 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("/qdrant.Points/Query");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Query"));
self.inner.unary(req, path, codec).await
}
/// Universally query points in a batch fashion.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
pub async fn query_batch(
&mut self,
request: impl tonic::IntoRequest<super::QueryBatchPoints>,
) -> std::result::Result<
tonic::Response<super::QueryBatchResponse>,
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("/qdrant.Points/QueryBatch");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "QueryBatch"));
self.inner.unary(req, path, codec).await
}
/// Universally query points in a group fashion.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
pub async fn query_groups(
&mut self,
request: impl tonic::IntoRequest<super::QueryPointGroups>,
) -> std::result::Result<
tonic::Response<super::QueryGroupsResponse>,
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(
"/qdrant.Points/QueryGroups",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "QueryGroups"));
self.inner.unary(req, path, codec).await
}
/// Perform facet counts.
/// For each value in the field, count the number of points that have this
/// value and match the conditions.
pub async fn facet(
&mut self,
request: impl tonic::IntoRequest<super::FacetCounts>,
) -> std::result::Result<tonic::Response<super::FacetResponse>, 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("/qdrant.Points/Facet");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Points", "Facet"));
self.inner.unary(req, path, codec).await
}
/// Compute distance matrix for sampled points with a pair based output format
pub async fn search_matrix_pairs(
&mut self,
request: impl tonic::IntoRequest<super::SearchMatrixPoints>,
) -> std::result::Result<
tonic::Response<super::SearchMatrixPairsResponse>,
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(
"/qdrant.Points/SearchMatrixPairs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "SearchMatrixPairs"));
self.inner.unary(req, path, codec).await
}
/// Compute distance matrix for sampled points with an offset based output format
pub async fn search_matrix_offsets(
&mut self,
request: impl tonic::IntoRequest<super::SearchMatrixPoints>,
) -> std::result::Result<
tonic::Response<super::SearchMatrixOffsetsResponse>,
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(
"/qdrant.Points/SearchMatrixOffsets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Points", "SearchMatrixOffsets"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod points_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with PointsServer.
#[async_trait]
pub trait Points: std::marker::Send + std::marker::Sync + 'static {
/// Perform insert + updates on points.
/// If a point with a given ID already exists - it will be overwritten.
async fn upsert(
&self,
request: tonic::Request<super::UpsertPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Delete points
async fn delete(
&self,
request: tonic::Request<super::DeletePoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Retrieve points
async fn get(
&self,
request: tonic::Request<super::GetPoints>,
) -> std::result::Result<tonic::Response<super::GetResponse>, tonic::Status>;
/// Update named vectors for point
async fn update_vectors(
&self,
request: tonic::Request<super::UpdatePointVectors>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Delete named vectors for points
async fn delete_vectors(
&self,
request: tonic::Request<super::DeletePointVectors>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Set payload for points
async fn set_payload(
&self,
request: tonic::Request<super::SetPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Overwrite payload for points
async fn overwrite_payload(
&self,
request: tonic::Request<super::SetPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Delete specified key payload for points
async fn delete_payload(
&self,
request: tonic::Request<super::DeletePayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Remove all payload for specified points
async fn clear_payload(
&self,
request: tonic::Request<super::ClearPayloadPoints>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Create index for field in collection
async fn create_field_index(
&self,
request: tonic::Request<super::CreateFieldIndexCollection>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Delete field index for collection
async fn delete_field_index(
&self,
request: tonic::Request<super::DeleteFieldIndexCollection>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Create a new named vector on the collection
async fn create_vector_name(
&self,
request: tonic::Request<super::CreateVectorNameRequest>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Delete a named vector from the collection
async fn delete_vector_name(
&self,
request: tonic::Request<super::DeleteVectorNameRequest>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponse>,
tonic::Status,
>;
/// Retrieve closest points based on vector similarity and given filtering
/// conditions
async fn search(
&self,
request: tonic::Request<super::SearchPoints>,
) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>;
/// Retrieve closest points based on vector similarity and given filtering
/// conditions
async fn search_batch(
&self,
request: tonic::Request<super::SearchBatchPoints>,
) -> std::result::Result<
tonic::Response<super::SearchBatchResponse>,
tonic::Status,
>;
/// Retrieve closest points based on vector similarity and given filtering
/// conditions, grouped by a given field
async fn search_groups(
&self,
request: tonic::Request<super::SearchPointGroups>,
) -> std::result::Result<
tonic::Response<super::SearchGroupsResponse>,
tonic::Status,
>;
/// Iterate over all or filtered points
async fn scroll(
&self,
request: tonic::Request<super::ScrollPoints>,
) -> std::result::Result<tonic::Response<super::ScrollResponse>, tonic::Status>;
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples.
async fn recommend(
&self,
request: tonic::Request<super::RecommendPoints>,
) -> std::result::Result<
tonic::Response<super::RecommendResponse>,
tonic::Status,
>;
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples.
async fn recommend_batch(
&self,
request: tonic::Request<super::RecommendBatchPoints>,
) -> std::result::Result<
tonic::Response<super::RecommendBatchResponse>,
tonic::Status,
>;
/// Look for the points which are closer to stored positive examples and at
/// the same time further to negative examples, grouped by a given field
async fn recommend_groups(
&self,
request: tonic::Request<super::RecommendPointGroups>,
) -> std::result::Result<
tonic::Response<super::RecommendGroupsResponse>,
tonic::Status,
>;
/// Use context and a target to find the most similar points to the target,
/// constrained by the context.
///
/// When using only the context (without a target), a special search - called
/// context search - is performed where pairs of points are used to generate a
/// loss that guides the search towards the zone where most positive examples
/// overlap. This means that the score minimizes the scenario of finding a
/// point closer to a negative than to a positive part of a pair.
///
/// Since the score of a context relates to loss, the maximum score a point
/// can get is 0.0, and it becomes normal that many points can have a score of
/// 0.0.
///
/// When using target (with or without context), the score behaves a little
/// different: The integer part of the score represents the rank with respect
/// to the context, while the decimal part of the score relates to the
/// distance to the target. The context part of the score for each pair is
/// calculated +1 if the point is closer to a positive than to a negative part
/// of a pair, and -1 otherwise.
async fn discover(
&self,
request: tonic::Request<super::DiscoverPoints>,
) -> std::result::Result<
tonic::Response<super::DiscoverResponse>,
tonic::Status,
>;
/// Batch request points based on { positive, negative } pairs of examples, and/or a target
async fn discover_batch(
&self,
request: tonic::Request<super::DiscoverBatchPoints>,
) -> std::result::Result<
tonic::Response<super::DiscoverBatchResponse>,
tonic::Status,
>;
/// Count points in collection with given filtering conditions
async fn count(
&self,
request: tonic::Request<super::CountPoints>,
) -> std::result::Result<tonic::Response<super::CountResponse>, tonic::Status>;
/// Perform multiple update operations in one request
async fn update_batch(
&self,
request: tonic::Request<super::UpdateBatchPoints>,
) -> std::result::Result<
tonic::Response<super::UpdateBatchResponse>,
tonic::Status,
>;
/// Universally query points.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
async fn query(
&self,
request: tonic::Request<super::QueryPoints>,
) -> std::result::Result<tonic::Response<super::QueryResponse>, tonic::Status>;
/// Universally query points in a batch fashion.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
async fn query_batch(
&self,
request: tonic::Request<super::QueryBatchPoints>,
) -> std::result::Result<
tonic::Response<super::QueryBatchResponse>,
tonic::Status,
>;
/// Universally query points in a group fashion.
/// This endpoint covers all capabilities of search, recommend, discover, filters.
/// But also enables hybrid and multi-stage queries.
async fn query_groups(
&self,
request: tonic::Request<super::QueryPointGroups>,
) -> std::result::Result<
tonic::Response<super::QueryGroupsResponse>,
tonic::Status,
>;
/// Perform facet counts.
/// For each value in the field, count the number of points that have this
/// value and match the conditions.
async fn facet(
&self,
request: tonic::Request<super::FacetCounts>,
) -> std::result::Result<tonic::Response<super::FacetResponse>, tonic::Status>;
/// Compute distance matrix for sampled points with a pair based output format
async fn search_matrix_pairs(
&self,
request: tonic::Request<super::SearchMatrixPoints>,
) -> std::result::Result<
tonic::Response<super::SearchMatrixPairsResponse>,
tonic::Status,
>;
/// Compute distance matrix for sampled points with an offset based output format
async fn search_matrix_offsets(
&self,
request: tonic::Request<super::SearchMatrixPoints>,
) -> std::result::Result<
tonic::Response<super::SearchMatrixOffsetsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct PointsServer<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> PointsServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 PointsServer<T>
where
T: Points,
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() {
"/qdrant.Points/Upsert" => {
#[allow(non_camel_case_types)]
struct UpsertSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::UpsertPoints>
for UpsertSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpsertPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::upsert(&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 = UpsertSvc(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)
}
"/qdrant.Points/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::DeletePoints>
for DeleteSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::delete(&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 = DeleteSvc(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)
}
"/qdrant.Points/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::GetPoints>
for GetSvc<T> {
type Response = super::GetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::get(&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 = GetSvc(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)
}
"/qdrant.Points/UpdateVectors" => {
#[allow(non_camel_case_types)]
struct UpdateVectorsSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::UpdatePointVectors>
for UpdateVectorsSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdatePointVectors>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::update_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 = UpdateVectorsSvc(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)
}
"/qdrant.Points/DeleteVectors" => {
#[allow(non_camel_case_types)]
struct DeleteVectorsSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeletePointVectors>
for DeleteVectorsSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePointVectors>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::delete_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 = DeleteVectorsSvc(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)
}
"/qdrant.Points/SetPayload" => {
#[allow(non_camel_case_types)]
struct SetPayloadSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SetPayloadPoints>
for SetPayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::set_payload(&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 = SetPayloadSvc(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)
}
"/qdrant.Points/OverwritePayload" => {
#[allow(non_camel_case_types)]
struct OverwritePayloadSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SetPayloadPoints>
for OverwritePayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::overwrite_payload(&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 = OverwritePayloadSvc(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)
}
"/qdrant.Points/DeletePayload" => {
#[allow(non_camel_case_types)]
struct DeletePayloadSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeletePayloadPoints>
for DeletePayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePayloadPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::delete_payload(&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 = DeletePayloadSvc(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)
}
"/qdrant.Points/ClearPayload" => {
#[allow(non_camel_case_types)]
struct ClearPayloadSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::ClearPayloadPoints>
for ClearPayloadSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ClearPayloadPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::clear_payload(&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 = ClearPayloadSvc(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)
}
"/qdrant.Points/CreateFieldIndex" => {
#[allow(non_camel_case_types)]
struct CreateFieldIndexSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::CreateFieldIndexCollection>
for CreateFieldIndexSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateFieldIndexCollection>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::create_field_index(&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 = CreateFieldIndexSvc(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)
}
"/qdrant.Points/DeleteFieldIndex" => {
#[allow(non_camel_case_types)]
struct DeleteFieldIndexSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeleteFieldIndexCollection>
for DeleteFieldIndexSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteFieldIndexCollection>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::delete_field_index(&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 = DeleteFieldIndexSvc(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)
}
"/qdrant.Points/CreateVectorName" => {
#[allow(non_camel_case_types)]
struct CreateVectorNameSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::CreateVectorNameRequest>
for CreateVectorNameSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateVectorNameRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::create_vector_name(&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 = CreateVectorNameSvc(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)
}
"/qdrant.Points/DeleteVectorName" => {
#[allow(non_camel_case_types)]
struct DeleteVectorNameSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DeleteVectorNameRequest>
for DeleteVectorNameSvc<T> {
type Response = super::PointsOperationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteVectorNameRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::delete_vector_name(&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 = DeleteVectorNameSvc(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)
}
"/qdrant.Points/Search" => {
#[allow(non_camel_case_types)]
struct SearchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SearchPoints>
for SearchSvc<T> {
type Response = super::SearchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::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 = SearchSvc(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)
}
"/qdrant.Points/SearchBatch" => {
#[allow(non_camel_case_types)]
struct SearchBatchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SearchBatchPoints>
for SearchBatchSvc<T> {
type Response = super::SearchBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchBatchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::search_batch(&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 = SearchBatchSvc(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)
}
"/qdrant.Points/SearchGroups" => {
#[allow(non_camel_case_types)]
struct SearchGroupsSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::SearchPointGroups>
for SearchGroupsSvc<T> {
type Response = super::SearchGroupsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchPointGroups>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::search_groups(&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 = SearchGroupsSvc(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)
}
"/qdrant.Points/Scroll" => {
#[allow(non_camel_case_types)]
struct ScrollSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::ScrollPoints>
for ScrollSvc<T> {
type Response = super::ScrollResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ScrollPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::scroll(&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 = ScrollSvc(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)
}
"/qdrant.Points/Recommend" => {
#[allow(non_camel_case_types)]
struct RecommendSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::RecommendPoints>
for RecommendSvc<T> {
type Response = super::RecommendResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::recommend(&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 = RecommendSvc(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)
}
"/qdrant.Points/RecommendBatch" => {
#[allow(non_camel_case_types)]
struct RecommendBatchSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::RecommendBatchPoints>
for RecommendBatchSvc<T> {
type Response = super::RecommendBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendBatchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::recommend_batch(&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 = RecommendBatchSvc(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)
}
"/qdrant.Points/RecommendGroups" => {
#[allow(non_camel_case_types)]
struct RecommendGroupsSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::RecommendPointGroups>
for RecommendGroupsSvc<T> {
type Response = super::RecommendGroupsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendPointGroups>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::recommend_groups(&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 = RecommendGroupsSvc(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)
}
"/qdrant.Points/Discover" => {
#[allow(non_camel_case_types)]
struct DiscoverSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::DiscoverPoints>
for DiscoverSvc<T> {
type Response = super::DiscoverResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DiscoverPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::discover(&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 = DiscoverSvc(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)
}
"/qdrant.Points/DiscoverBatch" => {
#[allow(non_camel_case_types)]
struct DiscoverBatchSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::DiscoverBatchPoints>
for DiscoverBatchSvc<T> {
type Response = super::DiscoverBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DiscoverBatchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::discover_batch(&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 = DiscoverBatchSvc(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)
}
"/qdrant.Points/Count" => {
#[allow(non_camel_case_types)]
struct CountSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::CountPoints>
for CountSvc<T> {
type Response = super::CountResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CountPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::count(&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 = CountSvc(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)
}
"/qdrant.Points/UpdateBatch" => {
#[allow(non_camel_case_types)]
struct UpdateBatchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::UpdateBatchPoints>
for UpdateBatchSvc<T> {
type Response = super::UpdateBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateBatchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::update_batch(&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 = UpdateBatchSvc(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)
}
"/qdrant.Points/Query" => {
#[allow(non_camel_case_types)]
struct QuerySvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::QueryPoints>
for QuerySvc<T> {
type Response = super::QueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::query(&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 = QuerySvc(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)
}
"/qdrant.Points/QueryBatch" => {
#[allow(non_camel_case_types)]
struct QueryBatchSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::QueryBatchPoints>
for QueryBatchSvc<T> {
type Response = super::QueryBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryBatchPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::query_batch(&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 = QueryBatchSvc(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)
}
"/qdrant.Points/QueryGroups" => {
#[allow(non_camel_case_types)]
struct QueryGroupsSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::QueryPointGroups>
for QueryGroupsSvc<T> {
type Response = super::QueryGroupsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryPointGroups>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::query_groups(&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 = QueryGroupsSvc(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)
}
"/qdrant.Points/Facet" => {
#[allow(non_camel_case_types)]
struct FacetSvc<T: Points>(pub Arc<T>);
impl<T: Points> tonic::server::UnaryService<super::FacetCounts>
for FacetSvc<T> {
type Response = super::FacetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FacetCounts>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::facet(&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 = FacetSvc(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)
}
"/qdrant.Points/SearchMatrixPairs" => {
#[allow(non_camel_case_types)]
struct SearchMatrixPairsSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::SearchMatrixPoints>
for SearchMatrixPairsSvc<T> {
type Response = super::SearchMatrixPairsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchMatrixPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::search_matrix_pairs(&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 = SearchMatrixPairsSvc(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)
}
"/qdrant.Points/SearchMatrixOffsets" => {
#[allow(non_camel_case_types)]
struct SearchMatrixOffsetsSvc<T: Points>(pub Arc<T>);
impl<
T: Points,
> tonic::server::UnaryService<super::SearchMatrixPoints>
for SearchMatrixOffsetsSvc<T> {
type Response = super::SearchMatrixOffsetsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SearchMatrixPoints>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Points>::search_matrix_offsets(&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 = SearchMatrixOffsetsSvc(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 PointsServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.Points";
impl<T> tonic::server::NamedService for PointsServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncPoints {
/// name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Wait until the changes have been applied?
#[prost(bool, optional, tag = "2")]
pub wait: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "3")]
pub points: ::prost::alloc::vec::Vec<PointStruct>,
/// Start of the sync range
#[prost(message, optional, tag = "4")]
pub from_id: ::core::option::Option<PointId>,
/// End of the sync range
#[prost(message, optional, tag = "5")]
pub to_id: ::core::option::Option<PointId>,
#[prost(message, optional, tag = "6")]
pub ordering: ::core::option::Option<WriteOrdering>,
/// Timeout for the request in seconds
#[prost(uint64, optional, tag = "7")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub sync_points: ::core::option::Option<SyncPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpsertPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub upsert_points: ::core::option::Option<UpsertPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub delete_points: ::core::option::Option<DeletePoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateVectorsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub update_vectors: ::core::option::Option<UpdatePointVectors>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteVectorsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub delete_vectors: ::core::option::Option<DeletePointVectors>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetPayloadPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub set_payload_points: ::core::option::Option<SetPayloadPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePayloadPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub delete_payload_points: ::core::option::Option<DeletePayloadPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearPayloadPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub clear_payload_points: ::core::option::Option<ClearPayloadPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateFieldIndexCollectionInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub create_field_index_collection: ::core::option::Option<
CreateFieldIndexCollection,
>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteFieldIndexCollectionInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub delete_field_index_collection: ::core::option::Option<
DeleteFieldIndexCollection,
>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
/// When present, overrides the `wait` parameter of the wrapped public message.
/// When absent, falls back to `wait` (backward compatible with older nodes).
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateVectorNameInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub create_vector_name: ::core::option::Option<CreateVectorNameRequest>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteVectorNameInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub delete_vector_name: ::core::option::Option<DeleteVectorNameRequest>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
#[prost(enumeration = "WaitUntil", optional, tag = "4")]
pub wait_override: ::core::option::Option<i32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOperation {
#[prost(
oneof = "update_operation::Update",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13"
)]
#[validate(nested)]
pub update: ::core::option::Option<update_operation::Update>,
}
/// Nested message and enum types in `UpdateOperation`.
pub mod update_operation {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Update {
#[prost(message, tag = "1")]
Sync(super::SyncPointsInternal),
#[prost(message, tag = "2")]
Upsert(super::UpsertPointsInternal),
#[prost(message, tag = "3")]
Delete(super::DeletePointsInternal),
#[prost(message, tag = "4")]
UpdateVectors(super::UpdateVectorsInternal),
#[prost(message, tag = "5")]
DeleteVectors(super::DeleteVectorsInternal),
#[prost(message, tag = "6")]
SetPayload(super::SetPayloadPointsInternal),
#[prost(message, tag = "7")]
OverwritePayload(super::SetPayloadPointsInternal),
#[prost(message, tag = "8")]
DeletePayload(super::DeletePayloadPointsInternal),
#[prost(message, tag = "9")]
ClearPayload(super::ClearPayloadPointsInternal),
#[prost(message, tag = "10")]
CreateFieldIndex(super::CreateFieldIndexCollectionInternal),
#[prost(message, tag = "11")]
DeleteFieldIndex(super::DeleteFieldIndexCollectionInternal),
#[prost(message, tag = "12")]
CreateVectorName(super::CreateVectorNameInternal),
#[prost(message, tag = "13")]
DeleteVectorName(super::DeleteVectorNameInternal),
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBatchInternal {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub operations: ::prost::alloc::vec::Vec<UpdateOperation>,
/// When present, overrides the `wait` parameter for all operations in the batch.
/// Propagated to individual operations if not already set.
#[prost(enumeration = "WaitUntil", optional, tag = "2")]
pub wait_override: ::core::option::Option<i32>,
}
/// Has to be backward compatible with `PointsOperationResponse`!
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PointsOperationResponseInternal {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<UpdateResultInternal>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub hardware_usage: ::core::option::Option<HardwareUsage>,
#[prost(message, optional, tag = "4")]
pub inference_usage: ::core::option::Option<InferenceUsage>,
}
/// Has to be backward compatible with `UpdateResult`!
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateResultInternal {
/// Number of operation
#[prost(uint64, optional, tag = "1")]
pub operation_id: ::core::option::Option<u64>,
/// Operation status
#[prost(enumeration = "UpdateStatus", tag = "2")]
pub status: i32,
#[prost(message, optional, tag = "3")]
pub clock_tag: ::core::option::Option<ClockTag>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClockTag {
#[prost(uint64, tag = "1")]
pub peer_id: u64,
#[prost(uint32, tag = "2")]
pub clock_id: u32,
#[prost(uint64, tag = "3")]
pub clock_tick: u64,
#[prost(uint64, tag = "4")]
pub token: u64,
#[prost(bool, tag = "5")]
pub force: bool,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub search_points: ::core::option::Option<SearchPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchBatchPointsInternal {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub search_points: ::prost::alloc::vec::Vec<SearchPoints>,
#[prost(uint32, optional, tag = "3")]
pub shard_id: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "4")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecoQuery {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub positives: ::prost::alloc::vec::Vec<Vector>,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub negatives: ::prost::alloc::vec::Vec<Vector>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextPair {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub positive: ::core::option::Option<Vector>,
#[prost(message, optional, tag = "2")]
#[validate(nested)]
pub negative: ::core::option::Option<Vector>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoveryQuery {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub target: ::core::option::Option<Vector>,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub context: ::prost::alloc::vec::Vec<ContextPair>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextQuery {
#[prost(message, repeated, tag = "1")]
#[validate(nested)]
pub context: ::prost::alloc::vec::Vec<ContextPair>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryEnum {
#[prost(oneof = "query_enum::Query", tags = "1, 2, 3, 4, 5")]
pub query: ::core::option::Option<query_enum::Query>,
}
/// Nested message and enum types in `QueryEnum`.
pub mod query_enum {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
/// ANN
#[prost(message, tag = "1")]
NearestNeighbors(super::Vector),
/// Recommend points with higher similarity to positive examples
#[prost(message, tag = "2")]
RecommendBestScore(super::RecoQuery),
/// Search for points that get closer to a target,
/// constrained by a context of positive and negative pairs
#[prost(message, tag = "3")]
Discover(super::DiscoveryQuery),
/// Use only the context to find points that minimize loss against negative examples
#[prost(message, tag = "4")]
Context(super::ContextQuery),
/// Recommend points which have the greatest sum of scores against all vectors.
/// Positive vectors are added, negatives are subtracted.
#[prost(message, tag = "5")]
RecommendSumScores(super::RecoQuery),
}
}
/// This is only used internally, so it makes more sense to add it here rather than in points.proto
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CoreSearchPoints {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub query: ::core::option::Option<QueryEnum>,
#[prost(message, optional, tag = "3")]
#[validate(nested)]
pub filter: ::core::option::Option<Filter>,
#[prost(uint64, tag = "4")]
#[validate(range(min = 1))]
pub limit: u64,
#[prost(message, optional, tag = "5")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "6")]
#[validate(nested)]
pub params: ::core::option::Option<SearchParams>,
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
#[prost(uint64, optional, tag = "8")]
pub offset: ::core::option::Option<u64>,
#[prost(string, optional, tag = "9")]
pub vector_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "10")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
#[prost(message, optional, tag = "11")]
pub read_consistency: ::core::option::Option<ReadConsistency>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CoreSearchBatchPointsInternal {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
#[validate(nested)]
pub search_points: ::prost::alloc::vec::Vec<CoreSearchPoints>,
#[prost(uint32, optional, tag = "3")]
pub shard_id: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "4")]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScrollPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub scroll_points: ::core::option::Option<ScrollPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecommendPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub recommend_points: ::core::option::Option<RecommendPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub get_points: ::core::option::Option<GetPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountPointsInternal {
#[prost(message, optional, tag = "1")]
#[validate(nested)]
pub count_points: ::core::option::Option<CountPoints>,
#[prost(uint32, optional, tag = "2")]
pub shard_id: ::core::option::Option<u32>,
}
/// A bare vector. No id reference here.
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawVector {
#[prost(oneof = "raw_vector::Variant", tags = "1, 2, 3")]
pub variant: ::core::option::Option<raw_vector::Variant>,
}
/// Nested message and enum types in `RawVector`.
pub mod raw_vector {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
#[prost(message, tag = "1")]
Dense(super::DenseVector),
#[prost(message, tag = "2")]
Sparse(super::SparseVector),
#[prost(message, tag = "3")]
MultiDense(super::MultiDenseVector),
}
}
/// Query variants for raw vectors (ids have been substituted with vectors)
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawQuery {
#[prost(oneof = "raw_query::Variant", tags = "1, 2, 3, 4, 5, 6")]
pub variant: ::core::option::Option<raw_query::Variant>,
}
/// Nested message and enum types in `RawQuery`.
pub mod raw_query {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Recommend {
#[prost(message, repeated, tag = "1")]
pub positives: ::prost::alloc::vec::Vec<super::RawVector>,
#[prost(message, repeated, tag = "2")]
pub negatives: ::prost::alloc::vec::Vec<super::RawVector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawContextPair {
#[prost(message, optional, tag = "1")]
pub positive: ::core::option::Option<super::RawVector>,
#[prost(message, optional, tag = "2")]
pub negative: ::core::option::Option<super::RawVector>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Discovery {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<super::RawVector>,
#[prost(message, repeated, tag = "2")]
pub context: ::prost::alloc::vec::Vec<RawContextPair>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Context {
#[prost(message, repeated, tag = "1")]
pub context: ::prost::alloc::vec::Vec<RawContextPair>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Feedback {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<super::RawVector>,
#[prost(message, repeated, tag = "2")]
pub feedback: ::prost::alloc::vec::Vec<RawFeedbackItem>,
#[prost(message, optional, tag = "3")]
pub strategy: ::core::option::Option<super::FeedbackStrategy>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawFeedbackItem {
#[prost(message, optional, tag = "1")]
pub vector: ::core::option::Option<super::RawVector>,
#[prost(float, tag = "2")]
pub score: f32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
/// ANN
#[prost(message, tag = "1")]
Nearest(super::RawVector),
/// Recommend points with highest similarity to positive examples,
/// or lowest to negative examples
#[prost(message, tag = "2")]
RecommendBestScore(Recommend),
/// Search for points that get closer to a target,
/// constrained by a context of positive and negative pairs
#[prost(message, tag = "3")]
Discover(Discovery),
/// Use only the context to find points that minimize loss against negative examples
#[prost(message, tag = "4")]
Context(Context),
/// Recommend points which have the greatest sum of scores against all vectors.
/// Positive vectors are added, negatives are subtracted.
#[prost(message, tag = "5")]
RecommendSumScores(Recommend),
#[prost(message, tag = "6")]
Feedback(Feedback),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MmrInternal {
/// Query vector to use for relevance
#[prost(message, optional, tag = "1")]
pub vector: ::core::option::Option<RawVector>,
/// Lambda parameter controlling diversity vs relevance trade-off
#[prost(float, tag = "2")]
pub lambda: f32,
#[prost(uint32, tag = "3")]
pub candidates_limit: u32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryShardPoints {
#[prost(message, repeated, tag = "1")]
pub prefetch: ::prost::alloc::vec::Vec<query_shard_points::Prefetch>,
#[prost(message, optional, tag = "2")]
pub query: ::core::option::Option<query_shard_points::Query>,
#[prost(string, optional, tag = "3")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub filter: ::core::option::Option<Filter>,
#[prost(uint64, tag = "5")]
pub limit: u64,
#[prost(message, optional, tag = "6")]
pub params: ::core::option::Option<SearchParams>,
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
#[prost(uint64, tag = "8")]
pub offset: u64,
#[prost(message, optional, tag = "9")]
pub with_payload: ::core::option::Option<WithPayloadSelector>,
#[prost(message, optional, tag = "10")]
pub with_vectors: ::core::option::Option<WithVectorsSelector>,
}
/// Nested message and enum types in `QueryShardPoints`.
pub mod query_shard_points {
#[derive(validator::Validate)]
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Query {
#[prost(oneof = "query::Score", tags = "1, 2, 3, 4, 5, 6, 7")]
pub score: ::core::option::Option<query::Score>,
}
/// Nested message and enum types in `Query`.
pub mod query {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Score {
/// (re)score against a vector query
#[prost(message, tag = "1")]
Vector(super::super::RawQuery),
/// One of the fusion methods
#[prost(enumeration = "super::super::Fusion", tag = "2")]
Fusion(i32),
/// Order by a field
#[prost(message, tag = "3")]
OrderBy(super::super::OrderBy),
/// Sample points
#[prost(enumeration = "super::super::Sample", tag = "4")]
Sample(i32),
/// Use an arbitrary formula to rescore points
#[prost(message, tag = "5")]
Formula(super::super::Formula),
/// Maximal Marginal Relevance
#[prost(message, tag = "6")]
Mmr(super::super::MmrInternal),
/// Parameterized RRF fusion
#[prost(message, tag = "7")]
Rrf(super::super::Rrf),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Prefetch {
#[prost(message, repeated, tag = "1")]
pub prefetch: ::prost::alloc::vec::Vec<Prefetch>,
#[prost(message, optional, tag = "2")]
pub query: ::core::option::Option<Query>,
#[prost(string, optional, tag = "3")]
pub using: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub filter: ::core::option::Option<super::Filter>,
#[prost(uint64, tag = "5")]
pub limit: u64,
#[prost(message, optional, tag = "6")]
pub params: ::core::option::Option<super::SearchParams>,
#[prost(float, optional, tag = "7")]
pub score_threshold: ::core::option::Option<f32>,
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBatchPointsInternal {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub query_points: ::prost::alloc::vec::Vec<QueryShardPoints>,
#[prost(uint32, optional, tag = "3")]
pub shard_id: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "4")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntermediateResult {
#[prost(message, repeated, tag = "1")]
pub result: ::prost::alloc::vec::Vec<ScoredPoint>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResultInternal {
#[prost(message, repeated, tag = "1")]
pub intermediate_results: ::prost::alloc::vec::Vec<IntermediateResult>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBatchResponseInternal {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<QueryResultInternal>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "5")]
pub hardware_usage: ::core::option::Option<HardwareUsage>,
#[prost(message, optional, tag = "6")]
pub inference_usage: ::core::option::Option<InferenceUsage>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FacetCountsInternal {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub filter: ::core::option::Option<Filter>,
#[prost(uint64, tag = "4")]
pub limit: u64,
#[prost(bool, tag = "5")]
pub exact: bool,
#[prost(uint32, tag = "6")]
pub shard_id: u32,
#[prost(uint64, optional, tag = "7")]
#[validate(range(min = 1))]
pub timeout: ::core::option::Option<u64>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FacetValueInternal {
#[prost(oneof = "facet_value_internal::Variant", tags = "1, 2, 3, 4")]
pub variant: ::core::option::Option<facet_value_internal::Variant>,
}
/// Nested message and enum types in `FacetValueInternal`.
pub mod facet_value_internal {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
#[prost(string, tag = "1")]
KeywordValue(::prost::alloc::string::String),
#[prost(int64, tag = "2")]
IntegerValue(i64),
#[prost(bytes, tag = "3")]
UuidValue(::prost::alloc::vec::Vec<u8>),
#[prost(bool, tag = "4")]
BoolValue(bool),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FacetHitInternal {
#[prost(message, optional, tag = "1")]
pub value: ::core::option::Option<FacetValueInternal>,
#[prost(uint64, tag = "2")]
pub count: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FacetResponseInternal {
#[prost(message, repeated, tag = "1")]
pub hits: ::prost::alloc::vec::Vec<FacetHitInternal>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
#[prost(message, optional, tag = "3")]
pub usage: ::core::option::Option<HardwareUsage>,
}
/// Controls how an update operation waits for completion.
/// When present, fully overrides the `wait` boolean from the wrapped public message.
/// When absent, the `wait` boolean is used (backward compatible with older nodes).
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WaitUntil {
/// Wait until the operation is written in WAL (equivalent to wait=false).
Wal = 0,
/// Wait until the operation is written in a segment (but not necessarily visible).
Segment = 1,
/// Wait until the operation is visible in search results (equivalent to wait=true).
Visible = 2,
}
impl WaitUntil {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Wal => "Wal",
Self::Segment => "Segment",
Self::Visible => "Visible",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Wal" => Some(Self::Wal),
"Segment" => Some(Self::Segment),
"Visible" => Some(Self::Visible),
_ => None,
}
}
}
/// Generated client implementations.
pub mod points_internal_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 PointsInternalClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PointsInternalClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> PointsInternalClient<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,
) -> PointsInternalClient<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,
{
PointsInternalClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 upsert(
&mut self,
request: impl tonic::IntoRequest<super::UpsertPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/Upsert",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Upsert"));
self.inner.unary(req, path, codec).await
}
pub async fn sync(
&mut self,
request: impl tonic::IntoRequest<super::SyncPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/Sync",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Sync"));
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeletePointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Delete"));
self.inner.unary(req, path, codec).await
}
pub async fn update_vectors(
&mut self,
request: impl tonic::IntoRequest<super::UpdateVectorsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/UpdateVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "UpdateVectors"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_vectors(
&mut self,
request: impl tonic::IntoRequest<super::DeleteVectorsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/DeleteVectors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "DeleteVectors"));
self.inner.unary(req, path, codec).await
}
pub async fn set_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/SetPayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "SetPayload"));
self.inner.unary(req, path, codec).await
}
pub async fn overwrite_payload(
&mut self,
request: impl tonic::IntoRequest<super::SetPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/OverwritePayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "OverwritePayload"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_payload(
&mut self,
request: impl tonic::IntoRequest<super::DeletePayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/DeletePayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "DeletePayload"));
self.inner.unary(req, path, codec).await
}
pub async fn clear_payload(
&mut self,
request: impl tonic::IntoRequest<super::ClearPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/ClearPayload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "ClearPayload"));
self.inner.unary(req, path, codec).await
}
pub async fn create_field_index(
&mut self,
request: impl tonic::IntoRequest<super::CreateFieldIndexCollectionInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/CreateFieldIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "CreateFieldIndex"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_field_index(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFieldIndexCollectionInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/DeleteFieldIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "DeleteFieldIndex"));
self.inner.unary(req, path, codec).await
}
pub async fn create_vector_name(
&mut self,
request: impl tonic::IntoRequest<super::CreateVectorNameInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/CreateVectorName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "CreateVectorName"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_vector_name(
&mut self,
request: impl tonic::IntoRequest<super::DeleteVectorNameInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/DeleteVectorName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "DeleteVectorName"));
self.inner.unary(req, path, codec).await
}
pub async fn update_batch(
&mut self,
request: impl tonic::IntoRequest<super::UpdateBatchInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
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(
"/qdrant.PointsInternal/UpdateBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "UpdateBatch"));
self.inner.unary(req, path, codec).await
}
pub async fn core_search_batch(
&mut self,
request: impl tonic::IntoRequest<super::CoreSearchBatchPointsInternal>,
) -> std::result::Result<
tonic::Response<super::SearchBatchResponse>,
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(
"/qdrant.PointsInternal/CoreSearchBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "CoreSearchBatch"));
self.inner.unary(req, path, codec).await
}
pub async fn scroll(
&mut self,
request: impl tonic::IntoRequest<super::ScrollPointsInternal>,
) -> std::result::Result<tonic::Response<super::ScrollResponse>, 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(
"/qdrant.PointsInternal/Scroll",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Scroll"));
self.inner.unary(req, path, codec).await
}
pub async fn count(
&mut self,
request: impl tonic::IntoRequest<super::CountPointsInternal>,
) -> std::result::Result<tonic::Response<super::CountResponse>, 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(
"/qdrant.PointsInternal/Count",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Count"));
self.inner.unary(req, path, codec).await
}
pub async fn recommend(
&mut self,
request: impl tonic::IntoRequest<super::RecommendPointsInternal>,
) -> std::result::Result<
tonic::Response<super::RecommendResponse>,
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(
"/qdrant.PointsInternal/Recommend",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Recommend"));
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetPointsInternal>,
) -> std::result::Result<tonic::Response<super::GetResponse>, 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(
"/qdrant.PointsInternal/Get",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.PointsInternal", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn query_batch(
&mut self,
request: impl tonic::IntoRequest<super::QueryBatchPointsInternal>,
) -> std::result::Result<
tonic::Response<super::QueryBatchResponseInternal>,
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(
"/qdrant.PointsInternal/QueryBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "QueryBatch"));
self.inner.unary(req, path, codec).await
}
pub async fn facet(
&mut self,
request: impl tonic::IntoRequest<super::FacetCountsInternal>,
) -> std::result::Result<
tonic::Response<super::FacetResponseInternal>,
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(
"/qdrant.PointsInternal/Facet",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.PointsInternal", "Facet"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod points_internal_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with PointsInternalServer.
#[async_trait]
pub trait PointsInternal: std::marker::Send + std::marker::Sync + 'static {
async fn upsert(
&self,
request: tonic::Request<super::UpsertPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn sync(
&self,
request: tonic::Request<super::SyncPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn delete(
&self,
request: tonic::Request<super::DeletePointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn update_vectors(
&self,
request: tonic::Request<super::UpdateVectorsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn delete_vectors(
&self,
request: tonic::Request<super::DeleteVectorsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn set_payload(
&self,
request: tonic::Request<super::SetPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn overwrite_payload(
&self,
request: tonic::Request<super::SetPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn delete_payload(
&self,
request: tonic::Request<super::DeletePayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn clear_payload(
&self,
request: tonic::Request<super::ClearPayloadPointsInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn create_field_index(
&self,
request: tonic::Request<super::CreateFieldIndexCollectionInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn delete_field_index(
&self,
request: tonic::Request<super::DeleteFieldIndexCollectionInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn create_vector_name(
&self,
request: tonic::Request<super::CreateVectorNameInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn delete_vector_name(
&self,
request: tonic::Request<super::DeleteVectorNameInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn update_batch(
&self,
request: tonic::Request<super::UpdateBatchInternal>,
) -> std::result::Result<
tonic::Response<super::PointsOperationResponseInternal>,
tonic::Status,
>;
async fn core_search_batch(
&self,
request: tonic::Request<super::CoreSearchBatchPointsInternal>,
) -> std::result::Result<
tonic::Response<super::SearchBatchResponse>,
tonic::Status,
>;
async fn scroll(
&self,
request: tonic::Request<super::ScrollPointsInternal>,
) -> std::result::Result<tonic::Response<super::ScrollResponse>, tonic::Status>;
async fn count(
&self,
request: tonic::Request<super::CountPointsInternal>,
) -> std::result::Result<tonic::Response<super::CountResponse>, tonic::Status>;
async fn recommend(
&self,
request: tonic::Request<super::RecommendPointsInternal>,
) -> std::result::Result<
tonic::Response<super::RecommendResponse>,
tonic::Status,
>;
async fn get(
&self,
request: tonic::Request<super::GetPointsInternal>,
) -> std::result::Result<tonic::Response<super::GetResponse>, tonic::Status>;
async fn query_batch(
&self,
request: tonic::Request<super::QueryBatchPointsInternal>,
) -> std::result::Result<
tonic::Response<super::QueryBatchResponseInternal>,
tonic::Status,
>;
async fn facet(
&self,
request: tonic::Request<super::FacetCountsInternal>,
) -> std::result::Result<
tonic::Response<super::FacetResponseInternal>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct PointsInternalServer<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> PointsInternalServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 PointsInternalServer<T>
where
T: PointsInternal,
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() {
"/qdrant.PointsInternal/Upsert" => {
#[allow(non_camel_case_types)]
struct UpsertSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::UpsertPointsInternal>
for UpsertSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpsertPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::upsert(&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 = UpsertSvc(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)
}
"/qdrant.PointsInternal/Sync" => {
#[allow(non_camel_case_types)]
struct SyncSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::SyncPointsInternal>
for SyncSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SyncPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::sync(&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 = SyncSvc(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)
}
"/qdrant.PointsInternal/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::DeletePointsInternal>
for DeleteSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::delete(&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 = DeleteSvc(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)
}
"/qdrant.PointsInternal/UpdateVectors" => {
#[allow(non_camel_case_types)]
struct UpdateVectorsSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::UpdateVectorsInternal>
for UpdateVectorsSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateVectorsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::update_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 = UpdateVectorsSvc(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)
}
"/qdrant.PointsInternal/DeleteVectors" => {
#[allow(non_camel_case_types)]
struct DeleteVectorsSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::DeleteVectorsInternal>
for DeleteVectorsSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteVectorsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::delete_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 = DeleteVectorsSvc(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)
}
"/qdrant.PointsInternal/SetPayload" => {
#[allow(non_camel_case_types)]
struct SetPayloadSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::SetPayloadPointsInternal>
for SetPayloadSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::set_payload(&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 = SetPayloadSvc(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)
}
"/qdrant.PointsInternal/OverwritePayload" => {
#[allow(non_camel_case_types)]
struct OverwritePayloadSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::SetPayloadPointsInternal>
for OverwritePayloadSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetPayloadPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::overwrite_payload(&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 = OverwritePayloadSvc(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)
}
"/qdrant.PointsInternal/DeletePayload" => {
#[allow(non_camel_case_types)]
struct DeletePayloadSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::DeletePayloadPointsInternal>
for DeletePayloadSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePayloadPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::delete_payload(&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 = DeletePayloadSvc(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)
}
"/qdrant.PointsInternal/ClearPayload" => {
#[allow(non_camel_case_types)]
struct ClearPayloadSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::ClearPayloadPointsInternal>
for ClearPayloadSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ClearPayloadPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::clear_payload(&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 = ClearPayloadSvc(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)
}
"/qdrant.PointsInternal/CreateFieldIndex" => {
#[allow(non_camel_case_types)]
struct CreateFieldIndexSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<
super::CreateFieldIndexCollectionInternal,
> for CreateFieldIndexSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::CreateFieldIndexCollectionInternal,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::create_field_index(&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 = CreateFieldIndexSvc(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)
}
"/qdrant.PointsInternal/DeleteFieldIndex" => {
#[allow(non_camel_case_types)]
struct DeleteFieldIndexSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<
super::DeleteFieldIndexCollectionInternal,
> for DeleteFieldIndexSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DeleteFieldIndexCollectionInternal,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::delete_field_index(&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 = DeleteFieldIndexSvc(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)
}
"/qdrant.PointsInternal/CreateVectorName" => {
#[allow(non_camel_case_types)]
struct CreateVectorNameSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::CreateVectorNameInternal>
for CreateVectorNameSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateVectorNameInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::create_vector_name(&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 = CreateVectorNameSvc(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)
}
"/qdrant.PointsInternal/DeleteVectorName" => {
#[allow(non_camel_case_types)]
struct DeleteVectorNameSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::DeleteVectorNameInternal>
for DeleteVectorNameSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteVectorNameInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::delete_vector_name(&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 = DeleteVectorNameSvc(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)
}
"/qdrant.PointsInternal/UpdateBatch" => {
#[allow(non_camel_case_types)]
struct UpdateBatchSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::UpdateBatchInternal>
for UpdateBatchSvc<T> {
type Response = super::PointsOperationResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateBatchInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::update_batch(&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 = UpdateBatchSvc(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)
}
"/qdrant.PointsInternal/CoreSearchBatch" => {
#[allow(non_camel_case_types)]
struct CoreSearchBatchSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::CoreSearchBatchPointsInternal>
for CoreSearchBatchSvc<T> {
type Response = super::SearchBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CoreSearchBatchPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::core_search_batch(&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 = CoreSearchBatchSvc(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)
}
"/qdrant.PointsInternal/Scroll" => {
#[allow(non_camel_case_types)]
struct ScrollSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::ScrollPointsInternal>
for ScrollSvc<T> {
type Response = super::ScrollResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ScrollPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::scroll(&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 = ScrollSvc(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)
}
"/qdrant.PointsInternal/Count" => {
#[allow(non_camel_case_types)]
struct CountSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::CountPointsInternal>
for CountSvc<T> {
type Response = super::CountResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CountPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::count(&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 = CountSvc(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)
}
"/qdrant.PointsInternal/Recommend" => {
#[allow(non_camel_case_types)]
struct RecommendSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::RecommendPointsInternal>
for RecommendSvc<T> {
type Response = super::RecommendResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecommendPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::recommend(&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 = RecommendSvc(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)
}
"/qdrant.PointsInternal/Get" => {
#[allow(non_camel_case_types)]
struct GetSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::GetPointsInternal>
for GetSvc<T> {
type Response = super::GetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::get(&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 = GetSvc(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)
}
"/qdrant.PointsInternal/QueryBatch" => {
#[allow(non_camel_case_types)]
struct QueryBatchSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::QueryBatchPointsInternal>
for QueryBatchSvc<T> {
type Response = super::QueryBatchResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryBatchPointsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::query_batch(&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 = QueryBatchSvc(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)
}
"/qdrant.PointsInternal/Facet" => {
#[allow(non_camel_case_types)]
struct FacetSvc<T: PointsInternal>(pub Arc<T>);
impl<
T: PointsInternal,
> tonic::server::UnaryService<super::FacetCountsInternal>
for FacetSvc<T> {
type Response = super::FacetResponseInternal;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FacetCountsInternal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as PointsInternal>::facet(&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 = FacetSvc(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 PointsInternalServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.PointsInternal";
impl<T> tonic::server::NamedService for PointsInternalServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTelemetryRequest {
/// The level of detail needed
#[prost(uint32, tag = "1")]
pub details_level: u32,
/// If present, select these collections
#[prost(message, optional, tag = "2")]
pub collections_selector: ::core::option::Option<CollectionsSelector>,
/// Timeout in secs for the request
#[prost(uint64, tag = "3")]
pub timeout: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionsSelector {
#[prost(string, repeated, tag = "1")]
pub only_collections: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTelemetryResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<PeerTelemetry>,
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerTelemetry {
/// app
#[prost(message, optional, tag = "2")]
pub app: ::core::option::Option<AppTelemetry>,
/// Mapping from collection name to its telemetry
#[prost(map = "string, message", tag = "3")]
pub collections: ::std::collections::HashMap<
::prost::alloc::string::String,
CollectionTelemetry,
>,
/// Telemetry about the cluster and peers
#[prost(message, optional, tag = "4")]
pub cluster: ::core::option::Option<ClusterTelemetry>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AppTelemetry {
/// Name of service
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Qdrant version
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
/// Last startup timestamp in seconds
#[prost(int64, tag = "3")]
pub startup: i64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionTelemetry {
/// Name of the collection
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Shards information
#[prost(message, repeated, tag = "4")]
pub shards: ::prost::alloc::vec::Vec<ReplicaSetTelemetry>,
/// Shard (replica) transfers in progress
#[prost(message, repeated, tag = "5")]
pub transfers: ::prost::alloc::vec::Vec<ShardTransferTelemetry>,
/// Resharding(s) in progress
#[prost(message, repeated, tag = "6")]
pub resharding: ::prost::alloc::vec::Vec<ReshardingTelemetry>,
/// Tasks that clean points after completing a resharding sequence
#[prost(map = "uint32, message", tag = "7")]
pub shard_clean_tasks: ::std::collections::HashMap<u32, ShardCleanStatusTelemetry>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardTransferTelemetry {
/// Local shard id
#[prost(uint32, tag = "1")]
pub shard_id: u32,
/// Target shard ID if different than source shard ID.
/// Used exclusively with `ReshardingStreamRecords` transfer method.
#[prost(uint32, optional, tag = "2")]
pub to_shard_id: ::core::option::Option<u32>,
/// From peer id
#[prost(uint64, tag = "3")]
pub from: u64,
/// To peer id
#[prost(uint64, tag = "4")]
pub to: u64,
/// If `true` transfer is a synchronization of replicas;
/// If `false` transfer is a moving of a shard from one peer to another.
#[prost(bool, tag = "5")]
pub sync: bool,
/// Method of transferring points
#[prost(enumeration = "ShardTransferMethod", optional, tag = "6")]
pub method: ::core::option::Option<i32>,
/// Freeform string. Typically reports progress
#[prost(string, tag = "7")]
pub comment: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReshardingTelemetry {
#[prost(string, tag = "1")]
pub uuid: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(uint64, tag = "3")]
pub peer_id: u64,
#[prost(message, optional, tag = "4")]
pub shard_key: ::core::option::Option<ShardKey>,
#[prost(enumeration = "ReshardingDirection", tag = "5")]
pub direction: i32,
#[prost(enumeration = "ReshardingStage", tag = "6")]
pub stage: i32,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardCleanStatusTelemetry {
#[prost(oneof = "shard_clean_status_telemetry::Variant", tags = "1, 2, 3, 4, 5")]
pub variant: ::core::option::Option<shard_clean_status_telemetry::Variant>,
}
/// Nested message and enum types in `ShardCleanStatusTelemetry`.
pub mod shard_clean_status_telemetry {
/// Marker message
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Started {}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Progress {
#[prost(uint64, tag = "1")]
pub deleted_points: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Failed {
#[prost(string, tag = "1")]
pub reason: ::prost::alloc::string::String,
}
/// Marker message
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Cancelled {}
/// Marker message
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Done {}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
#[prost(message, tag = "1")]
Started(Started),
#[prost(message, tag = "2")]
Progress(Progress),
#[prost(message, tag = "3")]
Failed(Failed),
#[prost(message, tag = "4")]
Cancelled(Cancelled),
#[prost(message, tag = "5")]
Done(Done),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplicaSetTelemetry {
/// Shard ID
#[prost(uint32, tag = "1")]
pub id: u32,
/// Optional shard key for custom sharding
#[prost(message, optional, tag = "2")]
pub key: ::core::option::Option<ShardKey>,
/// Local shard information
#[prost(message, optional, tag = "3")]
pub local: ::core::option::Option<LocalShardTelemetry>,
/// Remote shards
#[prost(message, repeated, tag = "4")]
pub remote: ::prost::alloc::vec::Vec<RemoteShardTelemetry>,
#[prost(map = "uint64, enumeration(ReplicaState)", tag = "5")]
pub replica_states: ::std::collections::HashMap<u64, i32>,
/// Snapshot operations telemetry
#[prost(message, optional, tag = "6")]
pub partial_snapshot: ::core::option::Option<PartialSnapshotTelemetry>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalShardTelemetry {
/// Optimization status
#[prost(enumeration = "ShardStatus", optional, tag = "3")]
pub status: ::core::option::Option<i32>,
/// Total optimized points
#[prost(uint64, tag = "4")]
pub total_optimized_points: u64,
/// Estimated vectors size in bytes
#[prost(uint64, optional, tag = "5")]
pub vectors_size_bytes: ::core::option::Option<u64>,
/// Estimated payloads size in bytes
#[prost(uint64, optional, tag = "6")]
pub payloads_size_bytes: ::core::option::Option<u64>,
/// Approximate number of points
#[prost(uint64, optional, tag = "7")]
pub num_points: ::core::option::Option<u64>,
/// Approximate number of vectors
#[prost(uint64, optional, tag = "8")]
pub num_vectors: ::core::option::Option<u64>,
/// Approximate number of vectors by vector name
#[prost(map = "string, uint64", tag = "9")]
pub num_vectors_by_name: ::std::collections::HashMap<
::prost::alloc::string::String,
u64,
>,
/// Number of vectors excluded from search if `indexed_only` is used
#[prost(map = "string, uint64", tag = "12")]
pub indexed_only_excluded_vectors: ::std::collections::HashMap<
::prost::alloc::string::String,
u64,
>,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteShardTelemetry {
#[prost(uint32, tag = "1")]
pub shard_id: u32,
#[prost(uint64, tag = "2")]
pub peer_id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PartialSnapshotTelemetry {
/// Number of ongoing snapshot creation requests
#[prost(uint64, tag = "1")]
pub ongoing_create_snapshot_requests: u64,
/// Whether the shard is recovering
#[prost(bool, tag = "2")]
pub is_recovering: bool,
/// Last successful recovery timestamp
#[prost(uint64, tag = "3")]
pub recovery_timestamp: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterTelemetry {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<ClusterStatusTelemetry>,
#[prost(map = "uint64, message", tag = "3")]
pub peers: ::std::collections::HashMap<u64, PeerInfo>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClusterStatusTelemetry {
#[prost(uint32, tag = "1")]
pub num_peers: u32,
#[prost(uint64, tag = "2")]
pub term: u64,
#[prost(uint64, tag = "3")]
pub commit: u64,
#[prost(uint64, tag = "4")]
pub pending_operations: u64,
#[prost(enumeration = "StateRole", optional, tag = "5")]
pub role: ::core::option::Option<i32>,
#[prost(bool, tag = "6")]
pub is_voter: bool,
#[prost(uint64, optional, tag = "7")]
pub peer_id: ::core::option::Option<u64>,
#[prost(message, optional, tag = "8")]
pub consensus_thread_status: ::core::option::Option<ConsensusThreadStatus>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConsensusThreadStatus {
#[prost(oneof = "consensus_thread_status::Status", tags = "1, 2, 3")]
pub status: ::core::option::Option<consensus_thread_status::Status>,
}
/// Nested message and enum types in `ConsensusThreadStatus`.
pub mod consensus_thread_status {
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Working {
/// Unix timestamp in milliseconds
#[prost(int64, tag = "1")]
pub last_update_ms: i64,
}
/// Marker message for stopped state
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Stopped {}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StoppedWithErr {
#[prost(string, tag = "1")]
pub err: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Status {
#[prost(message, tag = "1")]
Working(Working),
#[prost(message, tag = "2")]
Stopped(Stopped),
#[prost(message, tag = "3")]
StoppedWithErr(StoppedWithErr),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeerInfo {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReshardingStage {
MigratingPoints = 0,
ReadHashRingCommitted = 1,
WriteHashRingCommitted = 2,
}
impl ReshardingStage {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::MigratingPoints => "MIGRATING_POINTS",
Self::ReadHashRingCommitted => "READ_HASH_RING_COMMITTED",
Self::WriteHashRingCommitted => "WRITE_HASH_RING_COMMITTED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MIGRATING_POINTS" => Some(Self::MigratingPoints),
"READ_HASH_RING_COMMITTED" => Some(Self::ReadHashRingCommitted),
"WRITE_HASH_RING_COMMITTED" => Some(Self::WriteHashRingCommitted),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ShardStatus {
/// Shard is completely ready for requests
Green = 0,
/// Shard is available, but some segments are under optimization
Yellow = 1,
/// Shard is available, but some segments are pending optimization
Grey = 2,
/// Something is not OK:
///
/// * some operations failed and was not recovered
Red = 3,
}
impl ShardStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Green => "GREEN",
Self::Yellow => "YELLOW",
Self::Grey => "GREY",
Self::Red => "RED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"GREEN" => Some(Self::Green),
"YELLOW" => Some(Self::Yellow),
"GREY" => Some(Self::Grey),
"RED" => Some(Self::Red),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StateRole {
Follower = 0,
Candidate = 1,
Leader = 2,
PreCandidate = 3,
}
impl StateRole {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Follower => "FOLLOWER",
Self::Candidate => "CANDIDATE",
Self::Leader => "LEADER",
Self::PreCandidate => "PRE_CANDIDATE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FOLLOWER" => Some(Self::Follower),
"CANDIDATE" => Some(Self::Candidate),
"LEADER" => Some(Self::Leader),
"PRE_CANDIDATE" => Some(Self::PreCandidate),
_ => None,
}
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetConsensusCommitRequest {}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetConsensusCommitResponse {
/// Raft commit as u64
#[prost(int64, tag = "1")]
pub commit: i64,
/// Raft term as u64
#[prost(int64, tag = "2")]
pub term: i64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WaitOnConsensusCommitRequest {
/// Raft commit as u64
#[prost(int64, tag = "1")]
pub commit: i64,
/// Raft term as u64
#[prost(int64, tag = "2")]
pub term: i64,
/// Timeout in seconds
#[prost(int64, tag = "3")]
pub timeout: i64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WaitOnConsensusCommitResponse {
/// False if commit/term is diverged and never reached or if timed out.
#[prost(bool, tag = "1")]
pub ok: bool,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAuditLogRequest {
/// ISO-8601 start time (inclusive), omit for no lower bound
#[prost(string, optional, tag = "1")]
pub time_from: ::core::option::Option<::prost::alloc::string::String>,
/// ISO-8601 end time (exclusive), omit for no upper bound
#[prost(string, optional, tag = "2")]
pub time_to: ::core::option::Option<::prost::alloc::string::String>,
/// Key=value filters applied to every JSON field
#[prost(map = "string, string", tag = "3")]
pub filters: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Maximum number of entries to return
#[prost(uint64, tag = "4")]
pub limit: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAuditLogResponse {
/// Audit log entries as raw JSON strings (one per entry)
#[prost(string, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Generated client implementations.
pub mod qdrant_internal_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 QdrantInternalClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QdrantInternalClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> QdrantInternalClient<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,
) -> QdrantInternalClient<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,
{
QdrantInternalClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Get current commit and term on the target peer.
pub async fn get_consensus_commit(
&mut self,
request: impl tonic::IntoRequest<super::GetConsensusCommitRequest>,
) -> std::result::Result<
tonic::Response<super::GetConsensusCommitResponse>,
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(
"/qdrant.QdrantInternal/GetConsensusCommit",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.QdrantInternal", "GetConsensusCommit"));
self.inner.unary(req, path, codec).await
}
/// Wait until the target peer reached the given commit ID.
pub async fn wait_on_consensus_commit(
&mut self,
request: impl tonic::IntoRequest<super::WaitOnConsensusCommitRequest>,
) -> std::result::Result<
tonic::Response<super::WaitOnConsensusCommitResponse>,
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(
"/qdrant.QdrantInternal/WaitOnConsensusCommit",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("qdrant.QdrantInternal", "WaitOnConsensusCommit"),
);
self.inner.unary(req, path, codec).await
}
/// Get telemetry
pub async fn get_telemetry(
&mut self,
request: impl tonic::IntoRequest<super::GetTelemetryRequest>,
) -> std::result::Result<
tonic::Response<super::GetTelemetryResponse>,
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(
"/qdrant.QdrantInternal/GetTelemetry",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.QdrantInternal", "GetTelemetry"));
self.inner.unary(req, path, codec).await
}
/// Get audit log entries from this peer
pub async fn get_audit_log(
&mut self,
request: impl tonic::IntoRequest<super::GetAuditLogRequest>,
) -> std::result::Result<
tonic::Response<super::GetAuditLogResponse>,
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(
"/qdrant.QdrantInternal/GetAuditLog",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.QdrantInternal", "GetAuditLog"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod qdrant_internal_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with QdrantInternalServer.
#[async_trait]
pub trait QdrantInternal: std::marker::Send + std::marker::Sync + 'static {
/// Get current commit and term on the target peer.
async fn get_consensus_commit(
&self,
request: tonic::Request<super::GetConsensusCommitRequest>,
) -> std::result::Result<
tonic::Response<super::GetConsensusCommitResponse>,
tonic::Status,
>;
/// Wait until the target peer reached the given commit ID.
async fn wait_on_consensus_commit(
&self,
request: tonic::Request<super::WaitOnConsensusCommitRequest>,
) -> std::result::Result<
tonic::Response<super::WaitOnConsensusCommitResponse>,
tonic::Status,
>;
/// Get telemetry
async fn get_telemetry(
&self,
request: tonic::Request<super::GetTelemetryRequest>,
) -> std::result::Result<
tonic::Response<super::GetTelemetryResponse>,
tonic::Status,
>;
/// Get audit log entries from this peer
async fn get_audit_log(
&self,
request: tonic::Request<super::GetAuditLogRequest>,
) -> std::result::Result<
tonic::Response<super::GetAuditLogResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QdrantInternalServer<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> QdrantInternalServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 QdrantInternalServer<T>
where
T: QdrantInternal,
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() {
"/qdrant.QdrantInternal/GetConsensusCommit" => {
#[allow(non_camel_case_types)]
struct GetConsensusCommitSvc<T: QdrantInternal>(pub Arc<T>);
impl<
T: QdrantInternal,
> tonic::server::UnaryService<super::GetConsensusCommitRequest>
for GetConsensusCommitSvc<T> {
type Response = super::GetConsensusCommitResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetConsensusCommitRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QdrantInternal>::get_consensus_commit(&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 = GetConsensusCommitSvc(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)
}
"/qdrant.QdrantInternal/WaitOnConsensusCommit" => {
#[allow(non_camel_case_types)]
struct WaitOnConsensusCommitSvc<T: QdrantInternal>(pub Arc<T>);
impl<
T: QdrantInternal,
> tonic::server::UnaryService<super::WaitOnConsensusCommitRequest>
for WaitOnConsensusCommitSvc<T> {
type Response = super::WaitOnConsensusCommitResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::WaitOnConsensusCommitRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QdrantInternal>::wait_on_consensus_commit(
&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 = WaitOnConsensusCommitSvc(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)
}
"/qdrant.QdrantInternal/GetTelemetry" => {
#[allow(non_camel_case_types)]
struct GetTelemetrySvc<T: QdrantInternal>(pub Arc<T>);
impl<
T: QdrantInternal,
> tonic::server::UnaryService<super::GetTelemetryRequest>
for GetTelemetrySvc<T> {
type Response = super::GetTelemetryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTelemetryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QdrantInternal>::get_telemetry(&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 = GetTelemetrySvc(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)
}
"/qdrant.QdrantInternal/GetAuditLog" => {
#[allow(non_camel_case_types)]
struct GetAuditLogSvc<T: QdrantInternal>(pub Arc<T>);
impl<
T: QdrantInternal,
> tonic::server::UnaryService<super::GetAuditLogRequest>
for GetAuditLogSvc<T> {
type Response = super::GetAuditLogResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetAuditLogRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QdrantInternal>::get_audit_log(&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 = GetAuditLogSvc(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 QdrantInternalServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.QdrantInternal";
impl<T> tonic::server::NamedService for QdrantInternalServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RaftMessage {
#[prost(bytes = "vec", tag = "1")]
pub message: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AllPeers {
#[prost(message, repeated, tag = "1")]
pub all_peers: ::prost::alloc::vec::Vec<Peer>,
#[prost(uint64, tag = "2")]
pub first_peer_id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Peer {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub id: u64,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AddPeerToKnownMessage {
#[prost(string, optional, tag = "1")]
#[validate(custom(function = "common::validation::validate_not_empty"))]
pub uri: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "2")]
#[validate(range(min = 1))]
pub port: ::core::option::Option<u32>,
#[prost(uint64, tag = "3")]
pub id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeerId {
#[prost(uint64, tag = "1")]
pub id: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Uri {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod raft_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 RaftClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RaftClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> RaftClient<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,
) -> RaftClient<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,
{
RaftClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Send Raft message to another peer
pub async fn send(
&mut self,
request: impl tonic::IntoRequest<super::RaftMessage>,
) -> std::result::Result<tonic::Response<()>, 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("/qdrant.Raft/Send");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Raft", "Send"));
self.inner.unary(req, path, codec).await
}
/// Send to bootstrap peer
/// Returns uri by id if bootstrap knows this peer
pub async fn who_is(
&mut self,
request: impl tonic::IntoRequest<super::PeerId>,
) -> std::result::Result<tonic::Response<super::Uri>, 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("/qdrant.Raft/WhoIs");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Raft", "WhoIs"));
self.inner.unary(req, path, codec).await
}
/// Send to bootstrap peer
/// Adds peer to the network
/// Returns all peers
pub async fn add_peer_to_known(
&mut self,
request: impl tonic::IntoRequest<super::AddPeerToKnownMessage>,
) -> std::result::Result<tonic::Response<super::AllPeers>, 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(
"/qdrant.Raft/AddPeerToKnown",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Raft", "AddPeerToKnown"));
self.inner.unary(req, path, codec).await
}
/// DEPRECATED
/// Its functionality is now included in `AddPeerToKnown`
///
/// Send to bootstrap peer
/// Proposes to add this peer as participant of consensus
pub async fn add_peer_as_participant(
&mut self,
request: impl tonic::IntoRequest<super::PeerId>,
) -> std::result::Result<tonic::Response<()>, 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(
"/qdrant.Raft/AddPeerAsParticipant",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Raft", "AddPeerAsParticipant"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod raft_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with RaftServer.
#[async_trait]
pub trait Raft: std::marker::Send + std::marker::Sync + 'static {
/// Send Raft message to another peer
async fn send(
&self,
request: tonic::Request<super::RaftMessage>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
/// Send to bootstrap peer
/// Returns uri by id if bootstrap knows this peer
async fn who_is(
&self,
request: tonic::Request<super::PeerId>,
) -> std::result::Result<tonic::Response<super::Uri>, tonic::Status>;
/// Send to bootstrap peer
/// Adds peer to the network
/// Returns all peers
async fn add_peer_to_known(
&self,
request: tonic::Request<super::AddPeerToKnownMessage>,
) -> std::result::Result<tonic::Response<super::AllPeers>, tonic::Status>;
/// DEPRECATED
/// Its functionality is now included in `AddPeerToKnown`
///
/// Send to bootstrap peer
/// Proposes to add this peer as participant of consensus
async fn add_peer_as_participant(
&self,
request: tonic::Request<super::PeerId>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
}
#[derive(Debug)]
pub struct RaftServer<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> RaftServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 RaftServer<T>
where
T: Raft,
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() {
"/qdrant.Raft/Send" => {
#[allow(non_camel_case_types)]
struct SendSvc<T: Raft>(pub Arc<T>);
impl<T: Raft> tonic::server::UnaryService<super::RaftMessage>
for SendSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RaftMessage>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Raft>::send(&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 = SendSvc(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)
}
"/qdrant.Raft/WhoIs" => {
#[allow(non_camel_case_types)]
struct WhoIsSvc<T: Raft>(pub Arc<T>);
impl<T: Raft> tonic::server::UnaryService<super::PeerId>
for WhoIsSvc<T> {
type Response = super::Uri;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PeerId>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Raft>::who_is(&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 = WhoIsSvc(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)
}
"/qdrant.Raft/AddPeerToKnown" => {
#[allow(non_camel_case_types)]
struct AddPeerToKnownSvc<T: Raft>(pub Arc<T>);
impl<
T: Raft,
> tonic::server::UnaryService<super::AddPeerToKnownMessage>
for AddPeerToKnownSvc<T> {
type Response = super::AllPeers;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AddPeerToKnownMessage>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Raft>::add_peer_to_known(&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 = AddPeerToKnownSvc(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)
}
"/qdrant.Raft/AddPeerAsParticipant" => {
#[allow(non_camel_case_types)]
struct AddPeerAsParticipantSvc<T: Raft>(pub Arc<T>);
impl<T: Raft> tonic::server::UnaryService<super::PeerId>
for AddPeerAsParticipantSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PeerId>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Raft>::add_peer_as_participant(&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 = AddPeerAsParticipantSvc(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 RaftServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.Raft";
impl<T> tonic::server::NamedService for RaftServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateFullSnapshotRequest {}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListFullSnapshotsRequest {}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteFullSnapshotRequest {
/// Name of the full snapshot
#[prost(string, tag = "1")]
#[validate(length(min = 1))]
pub snapshot_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateSnapshotRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSnapshotsRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteSnapshotRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Name of the collection snapshot
#[prost(string, tag = "2")]
#[validate(length(min = 1))]
pub snapshot_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnapshotDescription {
/// Name of the snapshot
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Creation time of the snapshot
#[prost(message, optional, tag = "2")]
#[validate(custom(function = "crate::grpc::validate::validate_timestamp"))]
pub creation_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Size of the snapshot in bytes
#[prost(int64, tag = "3")]
pub size: i64,
/// SHA256 digest of the snapshot file
#[prost(string, optional, tag = "4")]
pub checksum: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSnapshotResponse {
#[prost(message, optional, tag = "1")]
pub snapshot_description: ::core::option::Option<SnapshotDescription>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsResponse {
#[prost(message, repeated, tag = "1")]
pub snapshot_descriptions: ::prost::alloc::vec::Vec<SnapshotDescription>,
/// Time spent to process
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteSnapshotResponse {
/// Time spent to process
#[prost(double, tag = "1")]
pub time: f64,
}
/// Generated client implementations.
pub mod snapshots_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 SnapshotsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SnapshotsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> SnapshotsClient<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,
) -> SnapshotsClient<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,
{
SnapshotsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Create collection snapshot
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
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("/qdrant.Snapshots/Create");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "Create"));
self.inner.unary(req, path, codec).await
}
/// List collection snapshots
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
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("/qdrant.Snapshots/List");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "List"));
self.inner.unary(req, path, codec).await
}
/// Delete collection snapshot
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
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("/qdrant.Snapshots/Delete");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "Delete"));
self.inner.unary(req, path, codec).await
}
/// Create full storage snapshot
pub async fn create_full(
&mut self,
request: impl tonic::IntoRequest<super::CreateFullSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
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(
"/qdrant.Snapshots/CreateFull",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Snapshots", "CreateFull"));
self.inner.unary(req, path, codec).await
}
/// List full storage snapshots
pub async fn list_full(
&mut self,
request: impl tonic::IntoRequest<super::ListFullSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
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(
"/qdrant.Snapshots/ListFull",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Snapshots", "ListFull"));
self.inner.unary(req, path, codec).await
}
/// Delete full storage snapshot
pub async fn delete_full(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFullSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
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(
"/qdrant.Snapshots/DeleteFull",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.Snapshots", "DeleteFull"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod snapshots_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with SnapshotsServer.
#[async_trait]
pub trait Snapshots: std::marker::Send + std::marker::Sync + 'static {
/// Create collection snapshot
async fn create(
&self,
request: tonic::Request<super::CreateSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
tonic::Status,
>;
/// List collection snapshots
async fn list(
&self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
tonic::Status,
>;
/// Delete collection snapshot
async fn delete(
&self,
request: tonic::Request<super::DeleteSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
tonic::Status,
>;
/// Create full storage snapshot
async fn create_full(
&self,
request: tonic::Request<super::CreateFullSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
tonic::Status,
>;
/// List full storage snapshots
async fn list_full(
&self,
request: tonic::Request<super::ListFullSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
tonic::Status,
>;
/// Delete full storage snapshot
async fn delete_full(
&self,
request: tonic::Request<super::DeleteFullSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SnapshotsServer<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> SnapshotsServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 SnapshotsServer<T>
where
T: Snapshots,
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() {
"/qdrant.Snapshots/Create" => {
#[allow(non_camel_case_types)]
struct CreateSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::CreateSnapshotRequest>
for CreateSvc<T> {
type Response = super::CreateSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::create(&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 = CreateSvc(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)
}
"/qdrant.Snapshots/List" => {
#[allow(non_camel_case_types)]
struct ListSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::ListSnapshotsRequest>
for ListSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListSnapshotsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::list(&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 = ListSvc(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)
}
"/qdrant.Snapshots/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::DeleteSnapshotRequest>
for DeleteSvc<T> {
type Response = super::DeleteSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::delete(&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 = DeleteSvc(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)
}
"/qdrant.Snapshots/CreateFull" => {
#[allow(non_camel_case_types)]
struct CreateFullSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::CreateFullSnapshotRequest>
for CreateFullSvc<T> {
type Response = super::CreateSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateFullSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::create_full(&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 = CreateFullSvc(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)
}
"/qdrant.Snapshots/ListFull" => {
#[allow(non_camel_case_types)]
struct ListFullSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::ListFullSnapshotsRequest>
for ListFullSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListFullSnapshotsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::list_full(&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 = ListFullSvc(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)
}
"/qdrant.Snapshots/DeleteFull" => {
#[allow(non_camel_case_types)]
struct DeleteFullSvc<T: Snapshots>(pub Arc<T>);
impl<
T: Snapshots,
> tonic::server::UnaryService<super::DeleteFullSnapshotRequest>
for DeleteFullSvc<T> {
type Response = super::DeleteSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteFullSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshots>::delete_full(&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 = DeleteFullSvc(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 SnapshotsServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.Snapshots";
impl<T> tonic::server::NamedService for SnapshotsServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateShardSnapshotRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListShardSnapshotsRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteShardSnapshotRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
/// Name of the shard snapshot
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub snapshot_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecoverShardSnapshotRequest {
/// Name of the collection
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
/// Id of the shard
#[prost(uint32, tag = "2")]
pub shard_id: u32,
/// Location of the shard snapshot
#[prost(message, optional, tag = "3")]
pub snapshot_location: ::core::option::Option<ShardSnapshotLocation>,
/// Priority of the shard snapshot
#[prost(enumeration = "ShardSnapshotPriority", tag = "4")]
pub snapshot_priority: i32,
/// SHA256 checksum for verifying snapshot integrity
#[prost(string, optional, tag = "5")]
#[validate(custom(function = "common::validation::validate_sha256_hash"))]
pub checksum: ::core::option::Option<::prost::alloc::string::String>,
/// Optional API key used when fetching the snapshot from a remote URL
#[prost(string, optional, tag = "6")]
pub api_key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShardSnapshotLocation {
#[prost(oneof = "shard_snapshot_location::Location", tags = "1, 2")]
pub location: ::core::option::Option<shard_snapshot_location::Location>,
}
/// Nested message and enum types in `ShardSnapshotLocation`.
pub mod shard_snapshot_location {
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Location {
/// URL of the remote shard snapshot
#[prost(string, tag = "1")]
Url(::prost::alloc::string::String),
/// Path of the local shard snapshot
#[prost(string, tag = "2")]
Path(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RecoverSnapshotResponse {
/// Time in seconds spent to process request
#[prost(double, tag = "1")]
pub time: f64,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ShardSnapshotPriority {
/// Restore snapshot without *any* additional synchronization
NoSync = 0,
/// Prefer snapshot data over the current state
Snapshot = 1,
/// Prefer existing data over the snapshot
Replica = 2,
/// Internal priority to use during snapshot shard transfer
ShardTransfer = 3,
}
impl ShardSnapshotPriority {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NoSync => "ShardSnapshotPriorityNoSync",
Self::Snapshot => "ShardSnapshotPrioritySnapshot",
Self::Replica => "ShardSnapshotPriorityReplica",
Self::ShardTransfer => "ShardSnapshotPriorityShardTransfer",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ShardSnapshotPriorityNoSync" => Some(Self::NoSync),
"ShardSnapshotPrioritySnapshot" => Some(Self::Snapshot),
"ShardSnapshotPriorityReplica" => Some(Self::Replica),
"ShardSnapshotPriorityShardTransfer" => Some(Self::ShardTransfer),
_ => None,
}
}
}
/// Generated client implementations.
pub mod shard_snapshots_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 ShardSnapshotsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ShardSnapshotsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> ShardSnapshotsClient<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,
) -> ShardSnapshotsClient<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,
{
ShardSnapshotsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Create shard snapshot
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
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(
"/qdrant.ShardSnapshots/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.ShardSnapshots", "Create"));
self.inner.unary(req, path, codec).await
}
/// List shard snapshots
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListShardSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
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(
"/qdrant.ShardSnapshots/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.ShardSnapshots", "List"));
self.inner.unary(req, path, codec).await
}
/// Delete shard snapshot
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
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(
"/qdrant.ShardSnapshots/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.ShardSnapshots", "Delete"));
self.inner.unary(req, path, codec).await
}
/// Recover shard snapshot
pub async fn recover(
&mut self,
request: impl tonic::IntoRequest<super::RecoverShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::RecoverSnapshotResponse>,
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(
"/qdrant.ShardSnapshots/Recover",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.ShardSnapshots", "Recover"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod shard_snapshots_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with ShardSnapshotsServer.
#[async_trait]
pub trait ShardSnapshots: std::marker::Send + std::marker::Sync + 'static {
/// Create shard snapshot
async fn create(
&self,
request: tonic::Request<super::CreateShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSnapshotResponse>,
tonic::Status,
>;
/// List shard snapshots
async fn list(
&self,
request: tonic::Request<super::ListShardSnapshotsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSnapshotsResponse>,
tonic::Status,
>;
/// Delete shard snapshot
async fn delete(
&self,
request: tonic::Request<super::DeleteShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSnapshotResponse>,
tonic::Status,
>;
/// Recover shard snapshot
async fn recover(
&self,
request: tonic::Request<super::RecoverShardSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::RecoverSnapshotResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ShardSnapshotsServer<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> ShardSnapshotsServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 ShardSnapshotsServer<T>
where
T: ShardSnapshots,
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() {
"/qdrant.ShardSnapshots/Create" => {
#[allow(non_camel_case_types)]
struct CreateSvc<T: ShardSnapshots>(pub Arc<T>);
impl<
T: ShardSnapshots,
> tonic::server::UnaryService<super::CreateShardSnapshotRequest>
for CreateSvc<T> {
type Response = super::CreateSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateShardSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ShardSnapshots>::create(&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 = CreateSvc(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)
}
"/qdrant.ShardSnapshots/List" => {
#[allow(non_camel_case_types)]
struct ListSvc<T: ShardSnapshots>(pub Arc<T>);
impl<
T: ShardSnapshots,
> tonic::server::UnaryService<super::ListShardSnapshotsRequest>
for ListSvc<T> {
type Response = super::ListSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListShardSnapshotsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ShardSnapshots>::list(&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 = ListSvc(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)
}
"/qdrant.ShardSnapshots/Delete" => {
#[allow(non_camel_case_types)]
struct DeleteSvc<T: ShardSnapshots>(pub Arc<T>);
impl<
T: ShardSnapshots,
> tonic::server::UnaryService<super::DeleteShardSnapshotRequest>
for DeleteSvc<T> {
type Response = super::DeleteSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteShardSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ShardSnapshots>::delete(&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 = DeleteSvc(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)
}
"/qdrant.ShardSnapshots/Recover" => {
#[allow(non_camel_case_types)]
struct RecoverSvc<T: ShardSnapshots>(pub Arc<T>);
impl<
T: ShardSnapshots,
> tonic::server::UnaryService<super::RecoverShardSnapshotRequest>
for RecoverSvc<T> {
type Response = super::RecoverSnapshotResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RecoverShardSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ShardSnapshots>::recover(&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 = RecoverSvc(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 ShardSnapshotsServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.ShardSnapshots";
impl<T> tonic::server::NamedService for ShardSnapshotsServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListFilesRequest {
/// Separated from `path` so that existing collection name validation can be applied at the proto level.
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub prefix_path: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FileExistsRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FileExistsResponse {
#[prost(bool, tag = "1")]
pub exists: bool,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListFilesEntry {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub size: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesResponse {
#[prost(message, repeated, tag = "1")]
pub files: ::prost::alloc::vec::Vec<ListFilesEntry>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FileLengthRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FileLengthResponse {
#[prost(uint64, tag = "1")]
pub length: u64,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBytesRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub byte_offset: u64,
#[prost(uint64, tag = "5")]
pub length: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBytesResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBytesStreamRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub byte_offset: u64,
#[prost(uint64, tag = "5")]
pub length: u64,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBytesStreamResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadWholeRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadWholeResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
/// ReadBatch: multiple ranges from a single file (maps to UniversalRead::read_batch).
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBatchRange {
#[prost(uint64, tag = "1")]
pub byte_offset: u64,
#[prost(uint64, tag = "2")]
pub length: u64,
}
#[derive(serde::Serialize)]
#[derive(validator::Validate)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadBatchRequest {
#[prost(string, tag = "1")]
#[validate(
length(min = 1, max = 255),
custom(function = "common::validation::validate_collection_name_legacy")
)]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub shard_id: u32,
#[prost(string, tag = "3")]
#[validate(length(min = 1))]
pub path: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
#[validate(length(min = 1))]
pub ranges: ::prost::alloc::vec::Vec<ReadBatchRange>,
}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadBatchResponse {
#[prost(bytes = "vec", repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Generated client implementations.
pub mod storage_read_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Shard-scoped raw I/O over on-disk collection storage.
///
/// All requests are routed to a single shard directory
/// (`<storage>/collections/<collection>/<shard_id>`). Replicas of the same
/// shard on different peers are not binary-compatible (segment IDs, WAL
/// positions, optimizer state all diverge), so the caller is responsible for
/// targeting the peer that owns the desired replica.
///
/// This service is intended for tooling that builds synchronization on top of
/// Qdrant (e.g. replica bootstrap) rather than typical user queries. It is
/// considered internal: the request/response shape may change between
/// releases.
#[derive(Debug, Clone)]
pub struct StorageReadClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StorageReadClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> StorageReadClient<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,
) -> StorageReadClient<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,
{
StorageReadClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// List files in the shard.
pub async fn list_files(
&mut self,
request: impl tonic::IntoRequest<super::ListFilesRequest>,
) -> std::result::Result<
tonic::Response<super::ListFilesResponse>,
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(
"/qdrant.StorageRead/ListFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "ListFiles"));
self.inner.unary(req, path, codec).await
}
/// Check if a file exists in the shard.
pub async fn file_exists(
&mut self,
request: impl tonic::IntoRequest<super::FileExistsRequest>,
) -> std::result::Result<
tonic::Response<super::FileExistsResponse>,
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(
"/qdrant.StorageRead/FileExists",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "FileExists"));
self.inner.unary(req, path, codec).await
}
/// Get the length of a file in the shard.
pub async fn file_length(
&mut self,
request: impl tonic::IntoRequest<super::FileLengthRequest>,
) -> std::result::Result<
tonic::Response<super::FileLengthResponse>,
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(
"/qdrant.StorageRead/FileLength",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "FileLength"));
self.inner.unary(req, path, codec).await
}
/// Maps to UniversalRead::read() — single range from a single file.
pub async fn read_bytes(
&mut self,
request: impl tonic::IntoRequest<super::ReadBytesRequest>,
) -> std::result::Result<
tonic::Response<super::ReadBytesResponse>,
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(
"/qdrant.StorageRead/ReadBytes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "ReadBytes"));
self.inner.unary(req, path, codec).await
}
/// Streaming variant of ReadBytes for large files, sends ~1MB chunks.
pub async fn read_bytes_stream(
&mut self,
request: impl tonic::IntoRequest<super::ReadBytesStreamRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ReadBytesStreamResponse>>,
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(
"/qdrant.StorageRead/ReadBytesStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "ReadBytesStream"));
self.inner.server_streaming(req, path, codec).await
}
/// Maps to UniversalRead::read_whole() — read an entire file.
pub async fn read_whole(
&mut self,
request: impl tonic::IntoRequest<super::ReadWholeRequest>,
) -> std::result::Result<
tonic::Response<super::ReadWholeResponse>,
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(
"/qdrant.StorageRead/ReadWhole",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "ReadWhole"));
self.inner.unary(req, path, codec).await
}
/// Maps to UniversalRead::read_batch() — multiple ranges from a single file.
pub async fn read_batch(
&mut self,
request: impl tonic::IntoRequest<super::ReadBatchRequest>,
) -> std::result::Result<
tonic::Response<super::ReadBatchResponse>,
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(
"/qdrant.StorageRead/ReadBatch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("qdrant.StorageRead", "ReadBatch"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod storage_read_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with StorageReadServer.
#[async_trait]
pub trait StorageRead: std::marker::Send + std::marker::Sync + 'static {
/// List files in the shard.
async fn list_files(
&self,
request: tonic::Request<super::ListFilesRequest>,
) -> std::result::Result<
tonic::Response<super::ListFilesResponse>,
tonic::Status,
>;
/// Check if a file exists in the shard.
async fn file_exists(
&self,
request: tonic::Request<super::FileExistsRequest>,
) -> std::result::Result<
tonic::Response<super::FileExistsResponse>,
tonic::Status,
>;
/// Get the length of a file in the shard.
async fn file_length(
&self,
request: tonic::Request<super::FileLengthRequest>,
) -> std::result::Result<
tonic::Response<super::FileLengthResponse>,
tonic::Status,
>;
/// Maps to UniversalRead::read() — single range from a single file.
async fn read_bytes(
&self,
request: tonic::Request<super::ReadBytesRequest>,
) -> std::result::Result<
tonic::Response<super::ReadBytesResponse>,
tonic::Status,
>;
/// Server streaming response type for the ReadBytesStream method.
type ReadBytesStreamStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ReadBytesStreamResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
/// Streaming variant of ReadBytes for large files, sends ~1MB chunks.
async fn read_bytes_stream(
&self,
request: tonic::Request<super::ReadBytesStreamRequest>,
) -> std::result::Result<
tonic::Response<Self::ReadBytesStreamStream>,
tonic::Status,
>;
/// Maps to UniversalRead::read_whole() — read an entire file.
async fn read_whole(
&self,
request: tonic::Request<super::ReadWholeRequest>,
) -> std::result::Result<
tonic::Response<super::ReadWholeResponse>,
tonic::Status,
>;
/// Maps to UniversalRead::read_batch() — multiple ranges from a single file.
async fn read_batch(
&self,
request: tonic::Request<super::ReadBatchRequest>,
) -> std::result::Result<
tonic::Response<super::ReadBatchResponse>,
tonic::Status,
>;
}
/// Shard-scoped raw I/O over on-disk collection storage.
///
/// All requests are routed to a single shard directory
/// (`<storage>/collections/<collection>/<shard_id>`). Replicas of the same
/// shard on different peers are not binary-compatible (segment IDs, WAL
/// positions, optimizer state all diverge), so the caller is responsible for
/// targeting the peer that owns the desired replica.
///
/// This service is intended for tooling that builds synchronization on top of
/// Qdrant (e.g. replica bootstrap) rather than typical user queries. It is
/// considered internal: the request/response shape may change between
/// releases.
#[derive(Debug)]
pub struct StorageReadServer<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> StorageReadServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 StorageReadServer<T>
where
T: StorageRead,
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() {
"/qdrant.StorageRead/ListFiles" => {
#[allow(non_camel_case_types)]
struct ListFilesSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::ListFilesRequest>
for ListFilesSvc<T> {
type Response = super::ListFilesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListFilesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::list_files(&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 = ListFilesSvc(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)
}
"/qdrant.StorageRead/FileExists" => {
#[allow(non_camel_case_types)]
struct FileExistsSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::FileExistsRequest>
for FileExistsSvc<T> {
type Response = super::FileExistsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FileExistsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::file_exists(&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 = FileExistsSvc(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)
}
"/qdrant.StorageRead/FileLength" => {
#[allow(non_camel_case_types)]
struct FileLengthSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::FileLengthRequest>
for FileLengthSvc<T> {
type Response = super::FileLengthResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FileLengthRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::file_length(&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 = FileLengthSvc(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)
}
"/qdrant.StorageRead/ReadBytes" => {
#[allow(non_camel_case_types)]
struct ReadBytesSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::ReadBytesRequest>
for ReadBytesSvc<T> {
type Response = super::ReadBytesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadBytesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::read_bytes(&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 = ReadBytesSvc(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)
}
"/qdrant.StorageRead/ReadBytesStream" => {
#[allow(non_camel_case_types)]
struct ReadBytesStreamSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::ServerStreamingService<
super::ReadBytesStreamRequest,
> for ReadBytesStreamSvc<T> {
type Response = super::ReadBytesStreamResponse;
type ResponseStream = T::ReadBytesStreamStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadBytesStreamRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::read_bytes_stream(&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 = ReadBytesStreamSvc(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.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/qdrant.StorageRead/ReadWhole" => {
#[allow(non_camel_case_types)]
struct ReadWholeSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::ReadWholeRequest>
for ReadWholeSvc<T> {
type Response = super::ReadWholeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadWholeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::read_whole(&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 = ReadWholeSvc(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)
}
"/qdrant.StorageRead/ReadBatch" => {
#[allow(non_camel_case_types)]
struct ReadBatchSvc<T: StorageRead>(pub Arc<T>);
impl<
T: StorageRead,
> tonic::server::UnaryService<super::ReadBatchRequest>
for ReadBatchSvc<T> {
type Response = super::ReadBatchResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadBatchRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StorageRead>::read_batch(&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 = ReadBatchSvc(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 StorageReadServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.StorageRead";
impl<T> tonic::server::NamedService for StorageReadServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthCheckRequest {}
#[derive(serde::Serialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthCheckReply {
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub commit: ::core::option::Option<::prost::alloc::string::String>,
}
/// Generated client implementations.
pub mod qdrant_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 QdrantClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QdrantClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
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> QdrantClient<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,
) -> QdrantClient<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,
{
QdrantClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 health_check(
&mut self,
request: impl tonic::IntoRequest<super::HealthCheckRequest>,
) -> std::result::Result<
tonic::Response<super::HealthCheckReply>,
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(
"/qdrant.Qdrant/HealthCheck",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("qdrant.Qdrant", "HealthCheck"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod qdrant_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with QdrantServer.
#[async_trait]
pub trait Qdrant: std::marker::Send + std::marker::Sync + 'static {
async fn health_check(
&self,
request: tonic::Request<super::HealthCheckRequest>,
) -> std::result::Result<
tonic::Response<super::HealthCheckReply>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QdrantServer<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> QdrantServer<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)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[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 QdrantServer<T>
where
T: Qdrant,
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() {
"/qdrant.Qdrant/HealthCheck" => {
#[allow(non_camel_case_types)]
struct HealthCheckSvc<T: Qdrant>(pub Arc<T>);
impl<
T: Qdrant,
> tonic::server::UnaryService<super::HealthCheckRequest>
for HealthCheckSvc<T> {
type Response = super::HealthCheckReply;
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 Qdrant>::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)
}
_ => {
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 QdrantServer<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,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "qdrant.Qdrant";
impl<T> tonic::server::NamedService for QdrantServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
use super::validate::ValidateExt;
use validator::Validate;