repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/top_k.rs
lib/common/common/src/top_k.rs
use std::cmp::Reverse; use ordered_float::Float; use crate::types::{ScoreType, ScoredPointOffset}; /// TopK implementation following the median algorithm described in /// <https://quickwit.io/blog/top-k-complexity>. /// /// Keeps the largest `k` ScoredPointOffset. #[derive(Default)] pub struct TopK { k: usize, ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/save_on_disk.rs
lib/common/common/src/save_on_disk.rs
use std::io::{BufReader, BufWriter, Write}; use std::ops::{Deref, DerefMut}; use std::path::{Path, PathBuf}; use std::time::Duration; use atomicwrites::OverwriteBehavior::AllowOverwrite; use atomicwrites::{AtomicFile, Error as AtomicWriteError}; use fs_err::{File, tokio as tokio_fs}; use parking_lot::{Condvar, Mutex, ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/progress_tracker.rs
lib/common/common/src/progress_tracker.rs
//! Hierarchical progress tracker. //! //! # Example //! //! ```text //! now //! ─────────────────────────── Time ────────────────────────────┴╢╢╢╢╢╢▢ //! //! β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Segment Indexing ──────────────────────╢╢╢╢╢╢╢ //! β”œβ”€β”€β”€β”€β”€β”€β”€ Quantization ────...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/fixed_length_priority_queue.rs
lib/common/common/src/fixed_length_priority_queue.rs
use std::cmp::Reverse; use std::collections::BinaryHeap; use std::num::NonZeroUsize; use std::vec::IntoIter as VecIntoIter; use bytemuck::{TransparentWrapper as _, TransparentWrapperAlloc as _}; use serde::{Deserialize, Serialize}; /// To avoid excessive memory allocation, FixedLengthPriorityQueue /// imposes a reaso...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/flags.rs
lib/common/common/src/flags.rs
use std::sync::OnceLock; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Global feature flags, normally initialized when starting Qdrant. static FEATURE_FLAGS: OnceLock<FeatureFlags> = OnceLock::new(); #[derive(Debug, Serialize, Deserialize, Clone, Copy, Eq, PartialEq, JsonSchema)] #[serde(default...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/either_variant.rs
lib/common/common/src/either_variant.rs
use std::iter; /// Variant works similar as Either, but for 4 variants. pub enum EitherVariant<A, B, C, D> { A(A), B(B), C(C), D(D), } macro_rules! for_all { ($value:expr, $pattern:pat => $result:expr) => { match $value { $crate::either_variant::EitherVariant::A($pattern) => $r...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/types.rs
lib/common/common/src/types.rs
use std::cmp::Ordering; use ordered_float::OrderedFloat; use strum::EnumIter; use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout}; /// Type of vector matching score pub type ScoreType = f32; /// Type of point index inside a segment pub type PointOffsetType = u32; #[derive(Copy, Clone, PartialEq, Debug, Defa...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/cow.rs
lib/common/common/src/cow.rs
//! [`std::borrow::Cow`]-like enums. //! //! # Comparison table //! //! | Type | Borrowed | Owned | //! | -------------------- | -------- | ----------------------- | //! | [`Cow<'a, T>`] | `&'a T` | `<T as ToOwned>::Owned` | //! | [`BoxCow<'a, T>`] | `&'a T` | `Box<T>` ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/zeros.rs
lib/common/common/src/zeros.rs
use std::io::{Result, Write}; static ZEROS: [u8; 8096] = [0u8; 8096]; pub trait WriteZerosExt { /// Write `len` zeros to the writer. fn write_zeros(&mut self, len: usize) -> Result<()>; } impl<W: Write> WriteZerosExt for W { fn write_zeros(&mut self, mut len: usize) -> Result<()> { while len > 0 ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/cpu.rs
lib/common/common/src/cpu.rs
use std::cmp::Ordering; #[cfg(target_os = "linux")] use thiserror::Error; #[cfg(target_os = "linux")] use thread_priority::{ThreadPriority, ThreadPriorityValue, set_current_thread_priority}; use crate::defaults::default_cpu_budget_unallocated; /// Try to read number of CPUs from environment variable `QDRANT_NUM_CPUS...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/maybe_uninit.rs
lib/common/common/src/maybe_uninit.rs
use std::mem::{MaybeUninit, transmute}; /// [`MaybeUninit::fill_from`] backported to stable. /// /// Unlike the standard library version, this function does not support [`Drop`] /// types, for simplicity of implementation. /// /// TODO: remove in favor of [`MaybeUninit::fill_from`] once stabilized. /// <https://github...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/tar_ext.rs
lib/common/common/src/tar_ext.rs
//! Extensions for the `tar` crate. use std::io::{self, Seek, Write}; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use tap::Tap; use tokio::sync::Mutex; use tokio::task::JoinError; /// A wrapper around [`tar::Builder`] that: /// 1. Usable both in sync and async c...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/defaults.rs
lib/common/common/src/defaults.rs
use std::time::Duration; use lazy_static::lazy_static; use semver::Version; use crate::cpu; /// Current Qdrant version string pub const QDRANT_VERSION_STRING: &str = "1.16.3"; lazy_static! { /// Current Qdrant semver version pub static ref QDRANT_VERSION: Version = Version::parse(QDRANT_VERSION_STRING).expe...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/disk.rs
lib/common/common/src/disk.rs
use std::path::{Path, PathBuf}; use fs_err as fs; use walkdir::WalkDir; /// How many bytes a directory takes on disk. /// /// Note: on non-unix systems, this function returns the apparent/logical /// directory size rather than actual disk usage. pub fn dir_disk_size(path: impl Into<PathBuf>) -> std::io::Result<u64> {...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/delta_pack.rs
lib/common/common/src/delta_pack.rs
use crate::bitpacking::{BitReader, BitWriter, packed_bits}; /// To simplify value counting, each value should be at least one byte. /// Otherwise, the count would be ambiguous, e.g., a 2-byte slice of 5-bit /// values could contain either 2 or 3 values. const MIN_BITS_PER_VALUE: u8 = u8::BITS as u8; /// How many bits...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/bitpacking_links.rs
lib/common/common/src/bitpacking_links.rs
use crate::bitpacking::{BitReader, BitWriter, make_bitmask, packed_bits}; /// To simplify value counting, each value should be at least one byte. /// Otherwise the count could would be ambiguous, e.g., a 2-byte slice of 5-bit /// values could contain either 2 or 3 values. pub const MIN_BITS_PER_VALUE: u8 = u8::BITS as...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/budget.rs
lib/common/common/src/budget.rs
use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::time::Duration; use tokio::sync::{OwnedSemaphorePermit, Semaphore, TryAcquireError}; use tokio::time; use crate::cpu; /// Get IO budget to use for optimizations as number of parallel IO operations. pub fn get_io_budget(io_budget: usize, cpu_budget: usiz...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/small_uint.rs
lib/common/common/src/small_uint.rs
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)] pub struct U24([u8; 3]); impl U24 { pub const MAX: u32 = 0xFFFFFF; #[inline] pub const fn new_wrapped(value: u32) -> Self { let arr = value.to_le_bytes(); Self([arr[0], arr[1], arr[2]]) } #[inline] pub const f...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/hardware_accumulator.rs
lib/common/common/src/counter/hardware_accumulator.rs
use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use super::hardware_counter::HardwareCounterCell; use super::hardware_data::HardwareData; /// Data structure, that routes hardware measurement counters to specific location. /// Shared drain MUST NOT create its own counters, but only hold a reference...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/iterator_hw_measurement.rs
lib/common/common/src/counter/iterator_hw_measurement.rs
use super::conditioned_counter::ConditionedCounter; use super::counter_cell::{CounterCell, OptionalCounterCell}; use super::hardware_accumulator::HwMeasurementAcc; use super::hardware_counter::HardwareCounterCell; use crate::iterator_ext::on_final_count::OnFinalCount; pub trait HwMeasurementIteratorExt: Iterator { ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/conditioned_counter.rs
lib/common/common/src/counter/conditioned_counter.rs
use super::counter_cell::{CounterCell, OptionalCounterCell}; use super::hardware_accumulator::HwMeasurementAcc; use super::hardware_counter::HardwareCounterCell; /// A counter that measures or disposes measurements based on a condition. /// This is needed in places where we need to decide at runtime whether to measure...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/counter_cell.rs
lib/common/common/src/counter/counter_cell.rs
use std::cell::Cell; /// A simple and efficient counter which doesn't need to be mutable for counting. /// /// It however cannot be shared across threads safely and thus doesn't implement `Sync` or `Send`. #[derive(Clone, Debug, Default, PartialEq)] pub struct CounterCell { counter: Cell<usize>, } impl CounterCel...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/hardware_data.rs
lib/common/common/src/counter/hardware_data.rs
use std::ops::Add; /// Contains all hardware metrics. Only serves as value holding structure without any semantics. #[derive(Copy, Clone, Default)] pub struct HardwareData { pub cpu: usize, pub payload_io_read: usize, pub payload_io_write: usize, pub vector_io_read: usize, pub vector_io_write: usiz...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/referenced_counter.rs
lib/common/common/src/counter/referenced_counter.rs
use std::ops::Deref; use super::counter_cell::CounterCell; use super::hardware_counter::HardwareCounterCell; /// Referenced hw counter for a single metric of a `HardwareCounterCell`. Can be used to pass a single metric type (eg. only cpu) /// to a function that needs measurement but depending on the context might mea...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/mod.rs
lib/common/common/src/counter/mod.rs
pub mod conditioned_counter; pub mod counter_cell; pub mod hardware_accumulator; pub mod hardware_counter; pub mod hardware_data; pub mod iterator_hw_measurement; pub mod referenced_counter;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/counter/hardware_counter.rs
lib/common/common/src/counter/hardware_counter.rs
use super::counter_cell::CounterCell; use super::hardware_accumulator::HwMeasurementAcc; use super::hardware_data::HardwareData; /// Collection of different types of hardware measurements. /// /// To ensure we don't miss consuming measurements, this struct will cause a panic on drop in tests and debug mode /// if it s...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/iterator_ext/on_final_count.rs
lib/common/common/src/iterator_ext/on_final_count.rs
pub struct OnFinalCount<I, F> where F: FnMut(usize), { wrapped_iter: I, callback: F, counter: usize, } impl<I, F> OnFinalCount<I, F> where F: FnMut(usize), { pub fn new(iter: I, f: F) -> Self { OnFinalCount { wrapped_iter: iter, callback: f, counter: ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/iterator_ext/stoppable_iter.rs
lib/common/common/src/iterator_ext/stoppable_iter.rs
use std::sync::atomic::{AtomicBool, Ordering}; pub struct StoppableIter<'a, I> { iter: I, is_stopped: &'a AtomicBool, } impl<'a, I> StoppableIter<'a, I> { pub fn new(iter: I, is_stopped: &'a AtomicBool) -> Self { Self { iter, is_stopped } } } impl<'a, I> Iterator for StoppableIter<'a, I> wher...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/iterator_ext/mod.rs
lib/common/common/src/iterator_ext/mod.rs
#[cfg(any(test, feature = "testing"))] use std::fmt::Debug; use std::sync::atomic::AtomicBool; use check_stopped::CheckStopped; use on_final_count::OnFinalCount; use crate::iterator_ext::stoppable_iter::StoppableIter; pub(super) mod on_final_count; mod check_stopped; pub mod stoppable_iter; pub trait IteratorExt: ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/src/iterator_ext/check_stopped.rs
lib/common/common/src/iterator_ext/check_stopped.rs
pub struct CheckStopped<I, F> { iter: I, f: F, every: usize, counter: usize, done: bool, } impl<I, F> CheckStopped<I, F> { pub fn new(iter: I, every: usize, f: F) -> Self { CheckStopped { iter, f, every, done: false, counter: 0...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/benches/bitpacking.rs
lib/common/common/benches/bitpacking.rs
use std::hint::black_box; use common::bitpacking::{BitReader, BitWriter}; use common::bitpacking_links::{iterate_packed_links, pack_links}; use common::bitpacking_ordered; use criterion::{BatchSize, Criterion, criterion_group, criterion_main}; use itertools::Itertools as _; use rand::rngs::StdRng; use rand::{Rng as _,...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/benches/mmap_hashmap.rs
lib/common/common/benches/mmap_hashmap.rs
use common::mmap_hashmap::{MmapHashMap, gen_ident, gen_map}; use criterion::{Criterion, criterion_group, criterion_main}; use rand::SeedableRng; use rand::rngs::StdRng; fn bench_mmap_hashmap(c: &mut Criterion) { let mut rng = StdRng::seed_from_u64(42); let map = gen_map(&mut rng, gen_ident, 100_000); let ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/benches/bitpacking_tango.rs
lib/common/common/benches/bitpacking_tango.rs
use std::cell::LazyCell; use std::hint::black_box; use std::rc::Rc; use common::bitpacking::{BitReader, BitWriter}; use common::bitpacking_links::iterate_packed_links; use common::bitpacking_ordered; use itertools::Itertools as _; use rand::rngs::StdRng; use rand::{Rng as _, SeedableRng as _}; use tango_bench::{ B...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/benches/atomic_stop.rs
lib/common/common/benches/atomic_stop.rs
use std::hint::black_box; use std::sync::atomic::Ordering; use common::iterator_ext::IteratorExt; use common::iterator_ext::stoppable_iter::StoppableIter; use criterion::{Criterion, criterion_group, criterion_main}; use rand::Rng; fn bench_atomic_stop(c: &mut Criterion) { // Generate random number from 1 to 1_000...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/benches/hw_counter.rs
lib/common/common/benches/hw_counter.rs
use common::counter::hardware_accumulator::HwMeasurementAcc; use common::counter::hardware_counter::HardwareCounterCell; use criterion::{Criterion, criterion_group, criterion_main}; fn bench_hw_counter(c: &mut Criterion) { c.bench_function("Disposable Hw Cell", |b| { b.iter(|| { let _ = Hardwar...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/dataset/src/lib.rs
lib/common/dataset/src/lib.rs
use std::path::{Path, PathBuf}; use anyhow::{Context, Result, anyhow}; use flate2::read::GzDecoder; use fs_err as fs; use fs_err::File; use indicatif::{ProgressBar, ProgressDrawTarget}; pub enum Dataset { // https://github.com/qdrant/sparse-vectors-experiments SpladeWikiMovies, // https://github.com/qdra...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/io/src/storage_version.rs
lib/common/io/src/storage_version.rs
use std::io::{Read, Write}; use std::path::Path; use atomicwrites::{AllowOverwrite, AtomicFile}; use fs_err::File; use semver::Version; use crate::file_operations::{FileOperationResult, FileStorageError}; pub const VERSION_FILE: &str = "version.info"; /// Structure to save and load version with which the storage wa...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/io/src/file_operations.rs
lib/common/io/src/file_operations.rs
use std::io::{self, BufReader, BufWriter, Write}; use std::path::Path; use std::result; use atomicwrites::{AtomicFile, OverwriteBehavior}; use fs_err::File; use serde::Serialize; use serde::de::DeserializeOwned; #[allow( clippy::disallowed_types, reason = "can't use `fs_err::File` since `atomicwrites` only pr...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/io/src/lib.rs
lib/common/io/src/lib.rs
pub mod file_operations; pub mod storage_version;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/search_result_aggregator.rs
lib/shard/src/search_result_aggregator.rs
use std::cmp::max; use ahash::{AHashMap, AHashSet}; use common::fixed_length_priority_queue::FixedLengthPriorityQueue; use common::types::ScoreType; use segment::types::{PointIdType, ScoredPoint, SeqNumberType}; /// Avoid excessive memory allocation and allocation failures on huge limits const LARGEST_REASONABLE_ALLO...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/lib.rs
lib/shard/src/lib.rs
pub mod locked_segment; pub mod operation_rate_cost; pub mod operations; pub mod payload_index_schema; pub mod proxy_segment; pub mod query; pub mod retrieve; pub mod search; pub mod search_result_aggregator; pub mod segment_holder; pub mod update; pub mod wal; pub mod common; #[cfg(feature = "testing")] pub mod fixtu...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/update.rs
lib/shard/src/update.rs
//! A collection of functions for updating points and payloads stored in segments use std::sync::atomic::AtomicBool; use ahash::{AHashMap, AHashSet}; use common::counter::hardware_counter::HardwareCounterCell; use itertools::iproduct; use parking_lot::{RwLock, RwLockWriteGuard}; use segment::common::operation_error::...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/locked_segment.rs
lib/shard/src/locked_segment.rs
use std::sync::Arc; use std::thread::sleep; use std::time::{Duration, Instant}; use parking_lot::RwLock; use segment::common::operation_error::{OperationError, OperationResult}; use segment::entry::entry_point::SegmentEntry; use segment::segment::Segment; use crate::proxy_segment::ProxySegment; const DROP_SPIN_TIMEO...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operation_rate_cost.rs
lib/shard/src/operation_rate_cost.rs
use segment::types::Filter; /// Base cost for a read operation pub const BASE_COST: usize = 1; pub fn filter_rate_cost(filter: &Filter) -> usize { filter.total_conditions_count() }
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/search.rs
lib/shard/src/search.rs
use api::rest::SearchRequestInternal; use common::types::ScoreType; use itertools::Itertools as _; use segment::data_types::vectors::{NamedQuery, NamedVectorStruct, VectorInternal}; use segment::types::{Filter, SearchParams, WithPayloadInterface, WithVector}; use segment::vector_storage::query::{ContextPair, ContextQue...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/fixtures.rs
lib/shard/src/fixtures.rs
use std::collections::HashSet; use std::path::Path; use common::counter::hardware_counter::HardwareCounterCell; use rand::Rng; use rand::rngs::ThreadRng; use segment::data_types::vectors::only_default_vector; use segment::entry::entry_point::SegmentEntry; use segment::payload_json; use segment::segment::Segment; use s...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/wal.rs
lib/shard/src/wal.rs
use std::marker::PhantomData; use std::path::Path; use std::result; use std::thread::JoinHandle; use io::file_operations::{atomic_save_json, read_json}; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use thiserror::Error; use wal::{Wal, WalOptions}; /// Write-Ahead-Log wrapper with built-in typ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/payload_index_schema.rs
lib/shard/src/payload_index_schema.rs
use std::collections::HashMap; use segment::types::{PayloadFieldSchema, PayloadKeyType}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PayloadIndexSchema { pub schema: HashMap<PayloadKeyType, PayloadFieldSchema>, }
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/retrieve/retrieve_blocking.rs
lib/shard/src/retrieve/retrieve_blocking.rs
use std::collections::hash_map::Entry; use std::sync::atomic::AtomicBool; use std::time::Duration; use ahash::AHashMap; use common::counter::hardware_accumulator::HwMeasurementAcc; use segment::common::operation_error::{OperationError, OperationResult}; use segment::data_types::named_vectors::NamedVectors; use segment...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/retrieve/mod.rs
lib/shard/src/retrieve/mod.rs
pub mod record_internal; pub mod retrieve_blocking;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/retrieve/record_internal.rs
lib/shard/src/retrieve/record_internal.rs
use api::conversions::json::payload_to_proto; use api::grpc::conversions::convert_shard_key_to_grpc; use segment::data_types::order_by::OrderValue; use segment::data_types::vectors::{DEFAULT_VECTOR_NAME, VectorRef, VectorStructInternal}; use segment::types::{Payload, PointIdType, ShardKey, VectorName}; use crate::oper...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/proxy_segment/tests.rs
lib/shard/src/proxy_segment/tests.rs
use std::sync::atomic::AtomicBool; use common::counter::hardware_accumulator::HwMeasurementAcc; use common::tar_ext; use fs_err::File; use segment::data_types::named_vectors::NamedVectors; use segment::data_types::query_context::QueryContext; use segment::data_types::vectors::{DEFAULT_VECTOR_NAME, QueryVector, only_de...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/proxy_segment/segment_entry.rs
lib/shard/src/proxy_segment/segment_entry.rs
use std::cmp; use std::collections::{BTreeSet, HashMap, HashSet}; use std::path::PathBuf; use std::sync::Arc; use std::sync::atomic::AtomicBool; use common::counter::hardware_counter::HardwareCounterCell; use common::types::TelemetryDetail; use segment::common::Flusher; use segment::common::operation_error::{Operation...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/proxy_segment/mod.rs
lib/shard/src/proxy_segment/mod.rs
pub mod segment_entry; pub mod snapshot_entry; #[cfg(test)] mod tests; use ahash::AHashMap; use bitvec::prelude::BitVec; use common::counter::hardware_counter::HardwareCounterCell; use common::types::PointOffsetType; use itertools::Itertools as _; use segment::common::operation_error::OperationResult; use segment::ty...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/proxy_segment/snapshot_entry.rs
lib/shard/src/proxy_segment/snapshot_entry.rs
use std::path::Path; use common::tar_ext; use segment::common::operation_error::OperationResult; use segment::data_types::manifest::SnapshotManifest; use segment::entry::snapshot_entry::SnapshotEntry; use segment::types::*; use super::ProxySegment; impl SnapshotEntry for ProxySegment { fn take_snapshot( ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/scroll.rs
lib/shard/src/query/scroll.rs
use segment::data_types::order_by::OrderBy; use segment::types::{Filter, WithPayloadInterface, WithVector}; use crate::operation_rate_cost; /// Scroll request, used as a part of query request #[derive(Clone, Debug, PartialEq)] pub struct QueryScrollRequestInternal { /// Page size. Default: 10 pub limit: usize...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/tests.rs
lib/shard/src/query/tests.rs
use ahash::AHashSet; use ordered_float::OrderedFloat; use segment::common::operation_error::OperationError; use segment::common::reciprocal_rank_fusion::DEFAULT_RRF_K; use segment::data_types::vectors::{MultiDenseVectorInternal, NamedQuery, VectorInternal}; use segment::json_path::JsonPath; use segment::types::*; use s...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/query_enum.rs
lib/shard/src/query/query_enum.rs
use api::grpc; use segment::data_types::vectors::*; use segment::types::{VectorName, VectorNameBuf}; use segment::vector_storage::query::*; use serde::Serialize; use sparse::common::sparse_vector::SparseVector; /// Every kind of vector query that can be performed on segment level. #[derive(Clone, Debug, PartialEq, Has...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/mod.rs
lib/shard/src/query/mod.rs
pub mod formula; pub mod mmr; pub mod planned_query; pub mod query_enum; pub mod scroll; pub mod query_context; #[cfg(test)] mod tests; use api::{grpc, rest}; use common::types::ScoreType; use itertools::Itertools; use ordered_float::OrderedFloat; use segment::common::reciprocal_rank_fusion::DEFAULT_RRF_K; use segmen...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/query_context.rs
lib/shard/src/query/query_context.rs
use std::sync::atomic::AtomicBool; use std::time::Duration; use common::counter::hardware_accumulator::HwMeasurementAcc; use common::iterator_ext::IteratorExt; use segment::common::operation_error::{OperationError, OperationResult}; use segment::data_types::query_context::QueryContext; use segment::types::VectorName; ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/planned_query.rs
lib/shard/src/query/planned_query.rs
use common::types::ScoreType; use ordered_float::OrderedFloat; use segment::common::operation_error::{OperationError, OperationResult}; use segment::data_types::vectors::NamedQuery; use segment::types::{Filter, SearchParams, WithPayloadInterface, WithVector}; use super::query_enum::QueryEnum; use super::scroll::{Query...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/formula.rs
lib/shard/src/query/formula.rs
use std::collections::{HashMap, HashSet}; use std::fmt; use api::grpc::DecayParamsExpression; use api::rest::GeoDistance; use api::{grpc, rest}; use common::types::ScoreType; use itertools::Itertools; use segment::common::operation_error::{OperationError, OperationResult}; use segment::index::query_optimization::resco...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/mmr/tests.rs
lib/shard/src/query/mmr/tests.rs
use std::collections::HashMap; use common::counter::hardware_accumulator::HwMeasurementAcc; use ordered_float::OrderedFloat; use rstest::rstest; use segment::data_types::vectors::{ MultiDenseVectorInternal, VectorInternal, VectorStructInternal, }; use segment::types::{ Distance, MultiVectorComparator, MultiVec...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/mmr/mod.rs
lib/shard/src/query/mmr/mod.rs
mod lazy_matrix; #[cfg(test)] mod tests; use common::counter::hardware_accumulator::HwMeasurementAcc; use common::counter::hardware_counter::HardwareCounterCell; use common::types::ScoreType; use indexmap::IndexSet; use itertools::Itertools as _; use ordered_float::OrderedFloat; use segment::common::operation_error::...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/query/mmr/lazy_matrix.rs
lib/shard/src/query/mmr/lazy_matrix.rs
use common::counter::hardware_accumulator::HwMeasurementAcc; use common::types::{PointOffsetType, ScoreType}; use segment::common::operation_error::OperationResult; use segment::data_types::vectors::{QueryVector, VectorInternal}; #[cfg(debug_assertions)] use segment::vector_storage::{Random, VectorStorage}; use segment...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operations/payload_ops.rs
lib/shard/src/operations/payload_ops.rs
use std::fmt; use api::rest::ShardKeySelector; use schemars::JsonSchema; use segment::json_path::JsonPath; use segment::types::{Filter, Payload, PayloadKeyType, PointIdType}; use serde; use serde::{Deserialize, Serialize}; use strum::{EnumDiscriminants, EnumIter}; use validator::Validate; /// Define operations descri...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operations/vector_ops.rs
lib/shard/src/operations/vector_ops.rs
use segment::types::{Filter, PointIdType, VectorNameBuf}; use serde::{Deserialize, Serialize}; use strum::{EnumDiscriminants, EnumIter}; use super::point_ops::{PointIdsList, VectorStructPersisted}; #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, EnumDiscriminants, Hash)] #[strum_discriminants(derive(EnumIte...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operations/mod.rs
lib/shard/src/operations/mod.rs
pub mod payload_ops; pub mod point_ops; #[cfg(feature = "staging")] pub mod staging; pub mod vector_ops; use segment::json_path::JsonPath; use segment::types::{PayloadFieldSchema, PointIdType}; use serde::{Deserialize, Serialize}; use strum::{EnumDiscriminants, EnumIter}; use crate::PeerId; use crate::operations::poi...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operations/staging.rs
lib/shard/src/operations/staging.rs
//! Staging-only operations for testing and debugging purposes. //! //! This module contains operations that are only available when the `staging` feature is enabled. use std::time::Duration; use ordered_float::OrderedFloat; use serde::{Deserialize, Serialize}; /// Test operation that introduces an artificial delay....
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/operations/point_ops.rs
lib/shard/src/operations/point_ops.rs
use std::collections::{HashMap, HashSet}; use std::fmt::{Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::{iter, mem}; use api::conversions::json::payload_to_proto; use api::rest::{ DenseVector, MultiDenseVector, ShardKeySelector, VectorOutput, VectorStructOutput, }; use common::validation::validate_mult...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/common/mod.rs
lib/shard/src/common/mod.rs
pub mod stopping_guard;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/common/stopping_guard.rs
lib/shard/src/common/stopping_guard.rs
use std::sync::Arc; use std::sync::atomic::AtomicBool; /// Structure that ensures that `is_stopped` flag is set to `true` when dropped. pub struct StoppingGuard { is_stopped: Arc<AtomicBool>, } impl StoppingGuard { /// Creates a new `StopGuard` instance. pub fn new() -> Self { Self { i...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/segment_holder/flush.rs
lib/shard/src/segment_holder/flush.rs
use std::cmp::{max, min}; use std::sync::atomic::Ordering; use std::thread::JoinHandle; use parking_lot::{RwLock, RwLockReadGuard}; use segment::common::operation_error::{OperationError, OperationResult}; use segment::entry::SegmentEntry; use segment::types::SeqNumberType; use crate::locked_segment::LockedSegment; us...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/segment_holder/tests.rs
lib/shard/src/segment_holder/tests.rs
use std::collections::HashMap; use std::str::FromStr; use rand::Rng; use segment::data_types::vectors::{DEFAULT_VECTOR_NAME, VectorInternal}; use segment::json_path::JsonPath; use segment::payload_json; use segment::segment_constructor::simple_segment_constructor::build_simple_segment; use segment::types::{Distance, P...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/segment_holder/mod.rs
lib/shard/src/segment_holder/mod.rs
mod flush; mod snapshot; #[cfg(test)] mod tests; use std::cmp::{max, min}; use std::collections::hash_map::Entry; use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashSet}; use std::ops::Deref; use std::path::Path; use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering}; use std...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/shard/src/segment_holder/snapshot.rs
lib/shard/src/segment_holder/snapshot.rs
use std::path::Path; use std::sync::Arc; use common::counter::hardware_counter::HardwareCounterCell; use common::save_on_disk::SaveOnDisk; use io::storage_version::StorageVersion; use parking_lot::{RwLockUpgradableReadGuard, RwLockWriteGuard}; use segment::common::operation_error::OperationResult; use segment::data_ty...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/codegen/src/pyclass_repr.rs
lib/edge/python/codegen/src/pyclass_repr.rs
pub fn pyclass_repr(input: proc_macro2::TokenStream) -> syn::Result<proc_macro2::TokenStream> { let impl_block: syn::ItemImpl = syn::parse2(input)?; let type_name = &impl_block.self_ty; let mut fields = Vec::new(); for item in &impl_block.items { let syn::ImplItem::Fn(func) = item else { ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/codegen/src/lib.rs
lib/edge/python/codegen/src/lib.rs
mod pyclass_repr; #[proc_macro_attribute] pub fn pyclass_repr( _attributes: proc_macro::TokenStream, input: proc_macro::TokenStream, ) -> proc_macro::TokenStream { match pyclass_repr::pyclass_repr(input.into()) { Ok(output) => output.into(), Err(error) => error.to_compile_error().into(), ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/lib.rs
lib/edge/python/src/lib.rs
pub mod config; pub mod query; pub mod repr; pub mod search; pub mod types; pub mod update; use std::path::PathBuf; use bytemuck::TransparentWrapperAlloc as _; use pyo3::exceptions::PyException; use pyo3::prelude::*; use segment::common::operation_error::OperationError; use segment::types::*; use self::config::*; us...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/update.rs
lib/edge/python/src/update.rs
use bytemuck::TransparentWrapperAlloc as _; use derive_more::Into; use pyo3::prelude::*; use segment::json_path::JsonPath; use segment::types::{Filter, Payload, VectorNameBuf}; use shard::operations::point_ops::{PointIdsList, PointInsertOperationsInternal}; use shard::operations::{CollectionUpdateOperations, payload_op...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/search.rs
lib/edge/python/src/search.rs
use bytemuck::{TransparentWrapper, TransparentWrapperAlloc as _}; use derive_more::Into; use ordered_float::OrderedFloat; use pyo3::IntoPyObjectExt as _; use pyo3::prelude::*; use shard::query::query_enum::QueryEnum; use shard::search::CoreSearchRequest; use crate::repr::*; use crate::*; #[pyclass(name = "SearchReque...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/query.rs
lib/edge/python/src/query.rs
use std::fmt; use bytemuck::{TransparentWrapper, TransparentWrapperAlloc as _}; use derive_more::Into; use ordered_float::OrderedFloat; use pyo3::IntoPyObjectExt; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use segment::data_types::order_by::{Direction, OrderBy, StartFrom}; use segment::data_types::vecto...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/repr.rs
lib/edge/python/src/repr.rs
use std::collections::{HashMap, HashSet}; use std::fmt; pub use edge_py_codegen::pyclass_repr; use pyo3::PyTypeInfo; pub trait Repr { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result; fn repr(&self) -> String { let mut repr = String::new(); self.fmt(&mut repr).expect("infallible"); ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/vector.rs
lib/edge/python/src/types/vector.rs
use std::collections::HashMap; use std::{fmt, mem}; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::IntoPyObjectExt; use pyo3::prelude::*; use segment::types::VectorNameBuf; use shard::operations::point_ops::{VectorPersisted, VectorStructPersisted}; use sparse::common::sparse_vector::SparseVector; u...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/value.rs
lib/edge/python/src/types/value.rs
use std::collections::HashMap; use std::{fmt, mem}; use bytemuck::{TransparentWrapper, TransparentWrapperAlloc as _}; use derive_more::Into; use pyo3::IntoPyObjectExt as _; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use pyo3::types::{PyDict, PyString}; use crate::repr::*; #[derive(Clone, Debug, Into, ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/record.rs
lib/edge/python/src/types/record.rs
use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::prelude::*; use shard::retrieve::record_internal::RecordInternal; use crate::repr::*; use crate::*; #[pyclass(name = "Record")] #[derive(Clone, Debug, Into, TransparentWrapper)] #[repr(transparent)] pub struct PyRecord(pub RecordInternal); #[pyclass_...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/mod.rs
lib/edge/python/src/types/mod.rs
pub mod filter; pub mod formula; pub mod json_path; pub mod order_value; pub mod payload; pub mod point; pub mod point_id; pub mod point_vectors; pub mod query; pub mod record; pub mod scored_point; pub mod value; pub mod vector; pub mod vector_internal; pub use self::filter::*; pub use self::formula::*; pub use self:...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/order_value.rs
lib/edge/python/src/types/order_value.rs
use std::fmt; use pyo3::prelude::*; use segment::data_types::order_by::OrderValue; use crate::repr::*; #[derive(IntoPyObject)] pub enum PyOrderValue { Int(i64), Float(f64), } impl Repr for PyOrderValue { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Self::Int(int...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/scored_point.rs
lib/edge/python/src/types/scored_point.rs
use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::prelude::*; use segment::types::ScoredPoint; use super::PyOrderValue; use crate::repr::*; use crate::{PyPayload, PyPointId, PyVectorInternal}; #[pyclass(name = "ScoredPoint")] #[derive(Clone, Debug, Into, TransparentWrapper)] #[repr(transparent)] pub ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/payload.rs
lib/edge/python/src/types/payload.rs
use std::fmt; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::prelude::*; use segment::types::*; use super::value::*; use crate::repr::*; #[derive(Clone, Debug, Into, TransparentWrapper)] #[repr(transparent)] pub struct PyPayload(pub Payload); impl FromPyObject<'_, '_> for PyPayload { type Er...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/point_id.rs
lib/edge/python/src/types/point_id.rs
use std::{fmt, mem}; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::IntoPyObjectExt as _; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use segment::types::PointIdType; use uuid::Uuid; use crate::repr::*; #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Into, TransparentWrapper)] #[r...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/vector_internal.rs
lib/edge/python/src/types/vector_internal.rs
use std::collections::HashMap; use std::{fmt, mem}; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::IntoPyObjectExt; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use pyo3::types::PyList; use segment::data_types::vectors::*; use segment::types::VectorNameBuf; use sparse::common::sparse_v...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/point_vectors.rs
lib/edge/python/src/types/point_vectors.rs
use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::{pyclass, pymethods}; use segment::types::PointIdType; use shard::operations::point_ops::VectorStructPersisted; use shard::operations::vector_ops::PointVectorsPersisted; use crate::repr::*; use crate::types::{PyPointId, PyVector}; #[pyclass(name = "Po...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/json_path.rs
lib/edge/python/src/types/json_path.rs
use std::convert::Infallible; use std::fmt; use std::str::FromStr as _; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use pyo3::types::PyString; use segment::json_path::JsonPath; use crate::repr::*; #[derive(Clone, Debug, Into, TransparentWrapper)]...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/point.rs
lib/edge/python/src/types/point.rs
use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::prelude::*; use segment::types::{Payload, PointIdType}; use shard::operations::point_ops::{PointStructPersisted, VectorStructPersisted}; use crate::repr::*; use crate::{PyPayload, PyPointId, PyVector}; #[pyclass(name = "Point")] #[derive(Clone, Debug,...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/filter/match.rs
lib/edge/python/src/types/filter/match.rs
use std::fmt; use std::hash::Hash; use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::IntoPyObjectExt as _; use pyo3::prelude::*; use pyo3::types::PyList; use segment::types::*; use crate::repr::*; #[derive(Clone, Debug, Into, TransparentWrapper)] #[repr(transparent)] pub struct PyMatch(pub Match); ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/filter/value_count.rs
lib/edge/python/src/types/filter/value_count.rs
use derive_more::Into; use pyo3::prelude::*; use segment::types::ValuesCount; use crate::repr::*; #[pyclass(name = "ValuesCount")] #[derive(Copy, Clone, Debug, Into)] pub struct PyValuesCount(pub ValuesCount); #[pyclass_repr] #[pymethods] impl PyValuesCount { #[new] #[pyo3(signature = (lt=None, gt=None, lte=...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/filter/field_condition.rs
lib/edge/python/src/types/filter/field_condition.rs
use bytemuck::TransparentWrapper; use derive_more::Into; use pyo3::prelude::*; use segment::json_path::JsonPath; use segment::types::*; use crate::repr::*; use crate::types::*; #[pyclass(name = "FieldCondition")] #[derive(Clone, Debug, Into, TransparentWrapper)] #[repr(transparent)] pub struct PyFieldCondition(pub Fi...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/filter/range.rs
lib/edge/python/src/types/filter/range.rs
use std::fmt; use derive_more::Into; use ordered_float::OrderedFloat; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use segment::types::*; use crate::repr::*; #[derive(Copy, Clone, Debug, FromPyObject, IntoPyObject)] pub enum PyRange { Float(PyRangeFloat), DateTime(PyRangeDateTime), } impl Repr ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/edge/python/src/types/filter/geo.rs
lib/edge/python/src/types/filter/geo.rs
use std::fmt; use bytemuck::{TransparentWrapper, TransparentWrapperAlloc as _}; use derive_more::Into; use ordered_float::OrderedFloat; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use segment::types::*; use crate::repr::*; #[pyclass(name = "GeoPoint")] #[derive(Copy, Clone, Debug, Into, TransparentWrap...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false