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/collection/src/shards/shard_holder/mod.rs
lib/collection/src/shards/shard_holder/mod.rs
mod resharding; pub(crate) mod shard_mapping; use std::collections::{HashMap, HashSet}; use std::ops::Deref as _; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::time::Duration; use ahash::AHashMap; use api::rest::ShardKeyWithFallback; use common::budget::ResourceBudget; use common::save_on_disk::SaveOnD...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/shard_holder/resharding.rs
lib/collection/src/shards/shard_holder/resharding.rs
use std::collections::{HashMap, HashSet}; use std::fmt; use std::ops::Deref as _; use std::sync::Arc; use common::counter::hardware_accumulator::HwMeasurementAcc; use segment::types::{Condition, CustomIdCheckerCondition as _, Filter, ShardKey}; use super::ShardHolder; use crate::config::ShardingMethod; use crate::has...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/update.rs
lib/collection/src/shards/replica_set/update.rs
use std::ops::Deref as _; use std::time::Duration; use common::counter::hardware_accumulator::HwMeasurementAcc; use futures::stream::FuturesUnordered; use futures::{FutureExt as _, StreamExt as _}; use itertools::Itertools as _; use tokio_util::task::AbortOnDropHandle; use super::{ShardReplicaSet, clock_set}; use cra...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/telemetry.rs
lib/collection/src/shards/replica_set/telemetry.rs
use std::ops::Deref as _; use std::time::Duration; use common::types::TelemetryDetail; use segment::types::SizeStats; use crate::operations::types::{CollectionResult, OptimizersStatus}; use crate::shards::replica_set::ShardReplicaSet; use crate::shards::telemetry::{PartialSnapshotTelemetry, ReplicaSetTelemetry}; imp...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/clock_set.rs
lib/collection/src/shards/replica_set/clock_set.rs
use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; #[derive(Clone, Debug, Default)] pub struct ClockSet { clocks: Vec<Arc<Clock>>, } impl ClockSet { pub fn new() -> Self { Self::default() } /// Get the first available clock from the set, or create a new one. pub...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/locally_disabled_peers.rs
lib/collection/src/shards/replica_set/locally_disabled_peers.rs
use std::cmp; use std::collections::HashMap; use std::time::{Duration, Instant}; use crate::shards::replica_set::replica_set_state::ReplicaState; use crate::shards::shard::PeerId; #[derive(Clone, Debug, Default)] pub struct Registry { /// List of disabled peer IDs and a backoff to prevent spamming consensus. ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/partial_snapshot_meta.rs
lib/collection/src/shards/replica_set/partial_snapshot_meta.rs
use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::{Duration, SystemTime}; use common::scope_tracker::{ScopeTracker, ScopeTrackerGuard}; use crate::operations::types::{CollectionError, CollectionResult}; /// API Flow: /// /// ┌─────────────────┐ /// │ recover_from API│ /// └───────┬─...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/mod.rs
lib/collection/src/shards/replica_set/mod.rs
pub mod clock_set; mod execute_read_operation; mod locally_disabled_peers; mod partial_snapshot_meta; mod read_ops; pub mod replica_set_state; mod shard_transfer; pub mod snapshots; mod telemetry; mod update; use std::collections::{HashMap, HashSet}; use std::ops::Deref as _; use std::path::{Path, PathBuf}; use std::s...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/snapshots.rs
lib/collection/src/shards/replica_set/snapshots.rs
use std::collections::HashSet; use std::io; use std::path::Path; use common::save_on_disk::SaveOnDisk; use common::tar_ext; use fs_err as fs; use fs_err::{File, tokio as tokio_fs}; use segment::data_types::manifest::{SegmentManifest, SnapshotManifest}; use segment::types::SnapshotFormat; use super::{REPLICA_STATE_FIL...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/replica_set_state.rs
lib/collection/src/shards/replica_set/replica_set_state.rs
use std::collections::HashMap; use schemars::JsonSchema; use segment::common::anonymize::Anonymize; use serde::{Deserialize, Serialize}; use crate::shards::shard::PeerId; /// Represents a replica set state #[derive(Debug, Deserialize, Serialize, Default, PartialEq, Eq, Clone)] pub struct ReplicaSetState { pub is...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/execute_read_operation.rs
lib/collection/src/shards/replica_set/execute_read_operation.rs
use std::cmp; use std::fmt::Write as _; use std::ops::Deref as _; use futures::future::{self, BoxFuture}; use futures::stream::FuturesUnordered; use futures::{FutureExt as _, StreamExt as _}; use rand::seq::SliceRandom as _; use super::ShardReplicaSet; use crate::operations::consistency_params::{ReadConsistency, Read...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/shard_transfer.rs
lib/collection/src/shards/replica_set/shard_transfer.rs
use std::ops::Deref as _; use std::sync::Arc; use parking_lot::Mutex; use segment::types::{Filter, PointIdType}; use super::ShardReplicaSet; use crate::hash_ring::HashRingRouter; use crate::operations::types::{CollectionError, CollectionResult}; use crate::shards::forward_proxy_shard::ForwardProxyShard; use crate::sh...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/shards/replica_set/read_ops.rs
lib/collection/src/shards/replica_set/read_ops.rs
use std::sync::Arc; use std::time::Duration; use common::counter::hardware_accumulator::HwMeasurementAcc; use futures::FutureExt as _; use segment::data_types::facets::{FacetParams, FacetResponse}; use segment::types::*; use shard::retrieve::record_internal::RecordInternal; use shard::search::CoreSearchRequestBatch; ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/profiling/interface.rs
lib/collection/src/profiling/interface.rs
use tokio::runtime::Handle; use tokio::sync::OnceCell; use crate::operations::loggable::Loggable; use crate::profiling::slow_requests_collector::{MIN_SLOW_REQUEST_DURATION, RequestProfileMessage}; use crate::profiling::slow_requests_log::LogEntry; static REQUESTS_COLLECTOR: OnceCell<crate::profiling::slow_requests_co...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/profiling/slow_requests_collector.rs
lib/collection/src/profiling/slow_requests_collector.rs
use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::{SystemTime, UNIX_EPOCH}; use chrono::{DateTime, Utc}; use tokio::sync::RwLock; use crate::operations::loggable::Loggable; use crate::profiling::slow_requests_log::SlowRequestsLog; /// Logger should ignore everything below this threshol...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/profiling/slow_requests_log.rs
lib/collection/src/profiling/slow_requests_log.rs
use std::hash::{Hash, Hasher}; use std::time::Duration; use ahash::AHashMap; use chrono::{DateTime, Utc}; use common::fixed_length_priority_queue::FixedLengthPriorityQueue; use count_min_sketch::CountMinSketch64; use itertools::Itertools; use schemars::JsonSchema; use serde::Serialize; use crate::operations::loggable...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/profiling/mod.rs
lib/collection/src/profiling/mod.rs
pub mod interface; mod slow_requests_collector; pub mod slow_requests_log;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/update_workers/optimization_worker.rs
lib/collection/src/update_workers/optimization_worker.rs
use std::collections::HashSet; use std::panic::AssertUnwindSafe; use std::path::Path; use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::time::Duration; use common::budget::ResourceBudget; use common::counter::hardware_counter::HardwareCounterCell; use common::panic; use common::s...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/update_workers/flush_workers.rs
lib/collection/src/update_workers/flush_workers.rs
use std::cmp::min; use std::path::PathBuf; use std::sync::Arc; use std::sync::atomic::AtomicU64; use std::time::Duration; use common::panic; use segment::common::operation_error::OperationResult; use segment::types::SeqNumberType; use shard::segment_holder::LockedSegmentHolder; use shard::wal::WalError; use tokio::syn...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/update_workers/mod.rs
lib/collection/src/update_workers/mod.rs
pub mod flush_workers; mod optimization_worker; mod update_worker; pub struct UpdateWorkers {}
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/update_workers/update_worker.rs
lib/collection/src/update_workers/update_worker.rs
use std::sync::Arc; use std::time::Instant; use common::counter::hardware_accumulator::HwMeasurementAcc; use segment::types::SeqNumberType; use shard::operations::CollectionUpdateOperations; use shard::segment_holder::LockedSegmentHolder; use tokio::sync::mpsc::{Receiver, Sender}; use crate::collection_manager::colle...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/problems/unindexed_field.rs
lib/collection/src/problems/unindexed_field.rs
use std::any::TypeId; use std::collections::{HashMap, HashSet}; use std::sync::OnceLock; use std::time::Duration; use http::header::CONTENT_TYPE; use http::{HeaderMap, HeaderValue, Method, Uri}; use issues::{Action, Code, ImmediateSolution, Issue, Solution}; use itertools::Itertools; use segment::common::operation_err...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/problems/mod.rs
lib/collection/src/problems/mod.rs
pub mod unindexed_field; pub use unindexed_field::UnindexedField;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/grouping/builder.rs
lib/collection/src/grouping/builder.rs
use std::time::Duration; use common::counter::hardware_accumulator::HwMeasurementAcc; use futures::Future; use itertools::Itertools; use tokio::sync::RwLockReadGuard; use super::group_by::{GroupRequest, group_by}; use crate::collection::Collection; use crate::lookup::lookup_ids; use crate::lookup::types::PseudoId; us...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/grouping/types.rs
lib/collection/src/grouping/types.rs
use ahash::AHashMap; use segment::data_types::groups::GroupId; use segment::json_path::JsonPath; use segment::types::{PointIdType, ScoredPoint}; use crate::operations::types::PointGroup; use crate::operations::universal_query::shard_query::ShardQueryRequest; #[derive(PartialEq, Debug)] pub(super) enum AggregatorError...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/grouping/mod.rs
lib/collection/src/grouping/mod.rs
mod aggregator; mod builder; pub mod group_by; mod types; pub use builder::GroupBy;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/grouping/group_by.rs
lib/collection/src/grouping/group_by.rs
use std::future::Future; use std::time::Duration; use ahash::AHashMap; use api::rest::{BaseGroupRequest, SearchGroupsRequestInternal, SearchRequestInternal}; use common::counter::hardware_accumulator::HwMeasurementAcc; use fnv::FnvBuildHasher; use indexmap::IndexSet; use segment::json_path::JsonPath; use segment::type...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/src/grouping/aggregator.rs
lib/collection/src/grouping/aggregator.rs
use std::cmp::Ordering; use std::collections::hash_map::Entry; use ahash::{AHashMap, AHashSet}; use itertools::Itertools; use segment::data_types::groups::GroupId; use segment::json_path::JsonPath; use segment::spaces::tools::{peek_top_largest_iterable, peek_top_smallest_iterable}; use segment::types::{ExtendedPointId...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/pagination_test.rs
lib/collection/tests/integration/pagination_test.rs
use api::rest::SearchRequestInternal; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ PointInsertOperationsInternal, PointOperations, PointStructPersisted, VectorStructPersisted, WriteOrdering, }; use collection::operations::shard_selector_internal::ShardSelector...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/distance_matrix_test.rs
lib/collection/tests/integration/distance_matrix_test.rs
use collection::collection::distance_matrix::CollectionSearchMatrixRequest; use collection::operations::point_ops::{ BatchPersisted, BatchVectorStructPersisted, WriteOrdering, }; use collection::operations::shard_selector_internal::ShardSelectorInternal; use common::counter::hardware_accumulator::HwMeasurementAcc; ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/multi_vec_test.rs
lib/collection/tests/integration/multi_vec_test.rs
use std::collections::BTreeMap; use std::num::NonZeroU32; use std::path::Path; use api::rest::SearchRequestInternal; use collection::collection::Collection; use collection::config::{CollectionConfigInternal, CollectionParams, WalConfig}; use collection::operations::CollectionUpdateOperations; use collection::operation...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/continuous_snapshot_test.rs
lib/collection/tests/integration/continuous_snapshot_test.rs
use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use std::time::Duration; use collection::collection::Collection; use collection::config::{CollectionConfigInternal, CollectionParams}; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ PointInsertOpera...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/main.rs
lib/collection/tests/integration/main.rs
mod collection_restore_test; mod collection_test; mod common; mod continuous_snapshot_test; mod distance_matrix_test; mod grouping_test; mod lookup_test; mod multi_vec_test; mod pagination_test; mod snapshot_recovery_test;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/grouping_test.rs
lib/collection/tests/integration/grouping_test.rs
use collection::collection::Collection; use collection::grouping::group_by::{GroupRequest, SourceRequest}; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::WriteOrdering; use collection::operations::types::{RecommendRequestInternal, UpdateStatus}; use itertools::Itertools; ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/collection_restore_test.rs
lib/collection/tests/integration/collection_restore_test.rs
use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ BatchPersisted, BatchVectorStructPersisted, PointInsertOperationsInternal, PointOperations, WriteOrdering, }; use collection::operations::shard_selector_internal::ShardSelectorInternal; use collection::operations::t...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/snapshot_recovery_test.rs
lib/collection/tests/integration/snapshot_recovery_test.rs
use std::sync::Arc; use api::rest::SearchRequestInternal; use collection::collection::Collection; use collection::config::{CollectionConfigInternal, CollectionParams, WalConfig}; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ PointInsertOperationsInternal, PointOpe...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/collection_test.rs
lib/collection/tests/integration/collection_test.rs
use std::collections::{HashMap, HashSet}; use std::io::{BufReader, BufWriter}; use ahash::AHashSet; use api::rest::{OrderByInterface, SearchRequestInternal}; use collection::operations::CollectionUpdateOperations; use collection::operations::payload_ops::{PayloadOps, SetPayloadOp}; use collection::operations::point_op...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/lookup_test.rs
lib/collection/tests/integration/lookup_test.rs
use collection::collection::Collection; use collection::lookup::types::PseudoId; use collection::lookup::{WithLookup, lookup_ids}; use collection::operations::consistency_params::ReadConsistency; use collection::operations::point_ops::{ BatchPersisted, BatchVectorStructPersisted, PointInsertOperationsInternal, Poin...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/tests/integration/common/mod.rs
lib/collection/tests/integration/common/mod.rs
use std::num::NonZeroU32; use std::path::Path; use std::sync::Arc; use collection::collection::{Collection, RequestShardTransfer}; use collection::config::{CollectionConfigInternal, CollectionParams, WalConfig}; use collection::operations::types::CollectionResult; use collection::operations::vector_params_builder::Vec...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/benches/prof.rs
lib/collection/benches/prof.rs
use std::io::Write; use std::os::raw::c_int; use std::path::Path; use criterion::profiler::Profiler; use fs_err as fs; use fs_err::File; use pprof::ProfilerGuard; use pprof::flamegraph::TextTruncateDirection; use pprof::protos::Message; /// Small custom profiler that can be used with Criterion to create a flamegraph ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/benches/hash_ring_bench.rs
lib/collection/benches/hash_ring_bench.rs
#[cfg(not(target_os = "windows"))] mod prof; use collection::hash_ring::HashRing; use criterion::{Criterion, criterion_group, criterion_main}; use rand::Rng; fn hash_ring_bench(c: &mut Criterion) { let mut group = c.benchmark_group("hash-ring-bench"); let mut ring_raw = HashRing::raw(); let mut ring_fair...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/benches/batch_search_bench.rs
lib/collection/benches/batch_search_bench.rs
use std::sync::Arc; use api::rest::SearchRequestInternal; use collection::config::{CollectionConfigInternal, CollectionParams, WalConfig}; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ PointInsertOperationsInternal, PointOperations, PointStructPersisted, }; use co...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/collection/benches/batch_query_bench.rs
lib/collection/benches/batch_query_bench.rs
use std::sync::Arc; use api::rest::SearchRequestInternal; use collection::config::{CollectionConfigInternal, CollectionParams, WalConfig}; use collection::operations::CollectionUpdateOperations; use collection::operations::point_ops::{ PointInsertOperationsInternal, PointOperations, PointStructPersisted, }; use co...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/build.rs
lib/api/build.rs
use std::path::PathBuf; use std::process::Command; use std::{env, str}; use common::defaults; use tonic_build::Builder; fn main() -> std::io::Result<()> { // Ensure Qdrant version is configured correctly assert_eq!( defaults::QDRANT_VERSION.to_string(), env!("CARGO_PKG_VERSION"), "crat...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/lib.rs
lib/api/src/lib.rs
pub mod conversions; pub mod grpc; pub mod rest;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/conversions/vectors.rs
lib/api/src/conversions/vectors.rs
use itertools::Itertools; use segment::common::operation_error::OperationError; use segment::data_types::vectors::{ DenseVector, MultiDenseVectorInternal, NamedVectorStruct, VectorInternal, VectorStructInternal, }; use sparse::common::sparse_vector::SparseVector; use tonic::Status; use crate::grpc::qdrant as grpc;...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/conversions/json.rs
lib/api/src/conversions/json.rs
use std::collections::HashMap; use segment::json_path::JsonPath; use tonic::Status; use crate::grpc::qdrant::value::Kind; use crate::grpc::qdrant::{ListValue, Struct, Value}; pub fn payload_to_proto(payload: segment::types::Payload) -> HashMap<String, Value> { payload .into_iter() .map(|(k, v)| (...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/conversions/mod.rs
lib/api/src/conversions/mod.rs
pub mod inference; pub mod json; pub mod vectors;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/conversions/inference.rs
lib/api/src/conversions/inference.rs
use tonic::Status; use crate::conversions::json::{dict_to_proto, json_to_proto, proto_dict_to_json, proto_to_json}; use crate::grpc::qdrant as grpc; use crate::rest::{DocumentOptions, Options, schema as rest}; impl From<rest::Document> for grpc::Document { fn from(document: rest::Document) -> Self { let r...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/dynamic_channel_pool.rs
lib/api/src/grpc/dynamic_channel_pool.rs
use std::time::Duration; use parking_lot::Mutex; use tonic::transport::{Channel, ClientTlsConfig, Error as TonicError, Uri}; use crate::grpc::dynamic_pool::{CountedItem, DynamicPool}; pub async fn make_grpc_channel( timeout: Duration, connection_timeout: Duration, uri: Uri, tls_config: Option<ClientT...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/transport_channel_pool.rs
lib/api/src/grpc/transport_channel_pool.rs
use std::collections::HashMap; use std::future::Future; use std::num::NonZeroUsize; use std::time::Duration; use rand::{Rng, rng}; use tokio::select; use tonic::codegen::InterceptedService; use tonic::service::Interceptor; use tonic::transport::{Channel, ClientTlsConfig, Error as TonicError, Uri}; use tonic::{Code, Re...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/dynamic_pool.rs
lib/api/src/grpc/dynamic_pool.rs
use std::collections::HashMap; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::{Duration, Instant}; use rand::Rng; #[derive(Debug)] struct ItemWithStats<T: Clone> { pub item: T, pub usage: AtomicUsize, pub last_success: AtomicUsize, } impl<T: Clone> ItemWithStats<T> { ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/mod.rs
lib/api/src/grpc/mod.rs
pub mod conversions; #[allow(clippy::all)] #[rustfmt::skip] // tonic uses `prettyplease` to format its output pub mod qdrant; pub mod dynamic_channel_pool; pub mod dynamic_pool; #[rustfmt::skip] // tonic uses `prettyplease` to format its output #[path = "grpc.health.v1.rs"] pub mod grpc_health_v1; pub mod ops; pub mod ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/grpc.health.v1.rs
lib/api/src/grpc/grpc.health.v1.rs
// This file is @generated by prost-build. #[derive(serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HealthCheckRequest { #[prost(string, tag = "1")] pub service: ::prost::alloc::string::String, } #[derive(serde::Serialize)] #[allow(clipp...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/conversions.rs
lib/api/src/grpc/conversions.rs
use std::collections::{BTreeMap, HashMap}; use std::str::FromStr as _; use std::time::Instant; use ahash::AHashSet; use chrono::{NaiveDateTime, Timelike}; use common::counter::hardware_accumulator::HwMeasurementAcc; use common::counter::hardware_data::HardwareData; use common::types::ScoreType; use itertools::Itertool...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/validate.rs
lib/api/src/grpc/validate.rs
use std::borrow::Cow; use std::collections::HashMap; use common::validation::{validate_range_generic, validate_shard_different_peers}; use segment::data_types::index::validate_integer_index_params; use validator::{Validate, ValidationError, ValidationErrors}; use super::qdrant as grpc; const TIMESTAMP_MIN_SECONDS: i...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/qdrant.rs
lib/api/src/grpc/qdrant.rs
// 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 /// obj...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/grpc/ops.rs
lib/api/src/grpc/ops.rs
use std::collections::HashMap; use crate::grpc::{HardwareUsage, InferenceUsage, ModelUsage, Usage}; impl HardwareUsage { pub fn add(&mut self, other: Self) { let Self { cpu, payload_io_read, payload_io_write, payload_index_io_read, payload_index_...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/rest/schema.rs
lib/api/src/rest/schema.rs
use std::borrow::Cow; use std::collections::HashMap; use std::hash::{Hash, Hasher}; use common::types::ScoreType; use common::validation::validate_multi_vector; use ordered_float::NotNan; use schemars::JsonSchema; use segment::common::utils::MaybeOneOrMany; use segment::data_types::index::{StemmingAlgorithm, Stopwords...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
true
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/rest/mod.rs
lib/api/src/rest/mod.rs
pub mod conversions; pub mod models; pub mod schema; pub mod validate; pub use schema::*;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/rest/conversions.rs
lib/api/src/rest/conversions.rs
use std::collections::HashMap; use segment::data_types::order_by::OrderBy; use segment::data_types::vectors::{VectorInternal, VectorStructInternal}; use uuid::Uuid; use super::schema::{ScoredPoint, Vector}; use super::{ FacetRequestInternal, FacetResponse, FacetValue, FacetValueHit, NearestQuery, OrderByInterface...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/rest/validate.rs
lib/api/src/rest/validate.rs
use std::borrow::Cow; use common::validation::validate_multi_vector; use segment::index::query_optimization::rescore_formula::parsed_formula::VariableId; use validator::{Validate, ValidationError, ValidationErrors}; use super::{ Batch, BatchVectorStruct, ContextInput, Expression, FormulaQuery, Fusion, NamedVector...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/api/src/rest/models.rs
lib/api/src/rest/models.rs
use std::fmt::Debug; use ahash::HashMap; use schemars::JsonSchema; use segment::common::anonymize::Anonymize; use segment::types::ShardKey; use serde; use serde::{Deserialize, Serialize}; pub fn get_git_commit_id() -> Option<String> { option_env!("GIT_COMMIT_ID") .map(ToString::to_string) .filter(...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/typemap.rs
lib/common/issues/src/typemap.rs
use std::any::{Any, TypeId}; use std::collections::HashMap; pub struct TypeMap(HashMap<TypeId, Box<dyn Any + Send + Sync>>); impl TypeMap { pub fn new() -> Self { Self(HashMap::new()) } pub fn has<T: 'static>(&self) -> bool { self.0.contains_key(&TypeId::of::<T>()) } pub fn insert...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/lib.rs
lib/common/issues/src/lib.rs
pub mod broker; mod dashboard; mod issue; pub mod problems; mod solution; pub(crate) mod typemap; pub use broker::{add_subscriber, publish}; pub use dashboard::{ Code, all_collection_issues, all_issues, clear, solve, solve_by_filter, submit, }; pub use issue::{Issue, IssueRecord}; pub use solution::{Action, Immedi...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/dashboard.rs
lib/common/issues/src/dashboard.rs
use std::any::TypeId; use std::collections::HashSet; use std::sync::{Arc, OnceLock}; use dashmap::DashMap; use crate::issue::{Issue, IssueRecord}; #[derive(Hash, Eq, PartialEq, Clone)] pub struct Code { pub issue_type: TypeId, pub instance_id: String, } impl Code { pub fn new<T: 'static>(instance_id: im...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/issue.rs
lib/common/issues/src/issue.rs
use std::fmt::Debug; use chrono::{DateTime, Utc}; use schemars::JsonSchema; use serde::Serialize; use crate::solution::Solution; pub trait Issue { /// Differentiates issues of the same type. This can hold any information that makes the issue unique and filterable. fn instance_id(&self) -> &str; /// The ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/broker.rs
lib/common/issues/src/broker.rs
use std::sync::{Arc, OnceLock, RwLock}; use crate::typemap::TypeMap; pub trait Subscriber<E> { fn notify(&self, event: Arc<E>); } struct SubscriberMap(TypeMap); type DynSubscriber<E> = Box<dyn Subscriber<E> + Send + Sync>; type SubscriVec<E> = Vec<Arc<DynSubscriber<E>>>; impl SubscriberMap { fn new() -> Se...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/solution.rs
lib/common/issues/src/solution.rs
use http::{HeaderMap, Method, Uri}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] #[serde(rename_all = "snake_case")] pub enum Solution { /// A solution that can be applied immediately Immediate(Box<ImmediateSol...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/problems/too_many_collections.rs
lib/common/issues/src/problems/too_many_collections.rs
use crate::issue::Issue; use crate::solution::Solution; pub struct TooManyCollections; impl Issue for TooManyCollections { fn instance_id(&self) -> &str { "" // Only one issue for the whole app } fn name() -> &'static str { "TOO_MANY_COLLECTIONS" } fn related_collection(&self) ->...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/issues/src/problems/mod.rs
lib/common/issues/src/problems/mod.rs
mod too_many_collections; pub use too_many_collections::TooManyCollections;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/cancel/src/blocking.rs
lib/common/cancel/src/blocking.rs
use tokio_util::task::AbortOnDropHandle; use super::*; /// # Cancel safety /// /// This function is cancel safe. /// /// If cancelled, the cancellation token provided to the `task` will be triggered automatically. /// /// This may prematurely abort the blocking task if it has not started yet. pub async fn spawn_cance...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/cancel/src/lib.rs
lib/common/cancel/src/lib.rs
pub mod blocking; pub mod future; pub use tokio_util::sync::{CancellationToken, DropGuard}; #[derive(Debug, thiserror::Error)] pub enum Error { #[error(transparent)] Join(#[from] tokio::task::JoinError), #[error("task was cancelled")] Cancelled, }
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/cancel/src/future.rs
lib/common/cancel/src/future.rs
use std::future::Future; use tokio::task::JoinHandle; use super::*; /// # Cancel safety /// /// This function is cancel safe. /// /// If cancelled, the cancellation token provided to the `task` will be triggered automatically. pub async fn spawn_cancel_on_drop<Task, Fut>(task: Task) -> Result<Fut::Output, Error> whe...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/build.rs
lib/common/memory/build.rs
fn main() { println!("cargo:rustc-check-cfg=cfg(posix_fadvise_supported)"); // Matches all platforms that have `nix::fcntl::posix_fadvise` function. // https://github.com/nix-rust/nix/blob/v0.29.0/src/fcntl.rs#L35-L42 if matches!( std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str(), ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/mmap_ops.rs
lib/common/memory/src/mmap_ops.rs
use std::mem::{align_of, size_of}; use std::path::Path; use std::sync::{LazyLock, OnceLock}; use std::{io, mem, ptr}; use fs_err as fs; use fs_err::{File, OpenOptions}; use memmap2::{Mmap, MmapMut}; use crate::madvise::{self, AdviceSetting, Madviseable}; pub const TEMP_FILE_EXTENSION: &str = "tmp"; /// If multiple ...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/mmap_type_readonly.rs
lib/common/memory/src/mmap_type_readonly.rs
//! Typed read-ponly memory maps //! //! This module adds type to directly map types and a slice of types onto a memory mapped file. //! The typed memory maps can be directly used as if it were that type. //! //! Types: //! - [`MmapTypeReadOnly`] //! - [`MmapSliceReadOnly`] //! //! Various additional functions are adde...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/chunked_utils.rs
lib/common/memory/src/chunked_utils.rs
use std::io; use std::path::{Path, PathBuf}; use ahash::AHashMap; use fs_err as fs; use crate::madvise::{Advice, AdviceSetting}; use crate::mmap_ops::{ MULTI_MMAP_IS_SUPPORTED, create_and_ensure_length, open_read_mmap, open_write_mmap, }; use crate::mmap_type::{Error as MmapError, MmapFlusher, MmapSlice}; use cra...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/lib.rs
lib/common/memory/src/lib.rs
pub mod checkfs; pub mod chunked_utils; pub mod fadvise; pub mod madvise; pub mod mmap_ops; pub mod mmap_type; pub mod mmap_type_readonly;
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/madvise.rs
lib/common/memory/src/madvise.rs
//! Platform-independent abstractions over [`memmap2::Mmap::advise`]/[`memmap2::MmapMut::advise`] //! and [`memmap2::Advice`]. use std::hint::black_box; use std::io; use std::num::Wrapping; use serde::Deserialize; /// Global [`Advice`] value, to trivially set [`Advice`] value /// used by all memmaps created by the `...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/checkfs.rs
lib/common/memory/src/checkfs.rs
// This file contains functions to verify that current file system is POSIX compliant. // There are some possible checks we can run here: // 1. Read information about the file system. If it is unknown or known to be not POSIX compliant, return false. // 2. Try to create, fill and save mmap file with some dummy data. If...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/fadvise.rs
lib/common/memory/src/fadvise.rs
use std::io::{self, IoSliceMut, Read, Seek}; use std::ops::Deref; use std::path::Path; use delegate::delegate; use fs_err::File; #[cfg(posix_fadvise_supported)] use nix::fcntl::{PosixFadviseAdvice, posix_fadvise}; #[cfg(posix_fadvise_supported)] fn fadvise(f: &impl std::os::unix::io::AsFd, advise: PosixFadviseAdvice)...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/memory/src/mmap_type.rs
lib/common/memory/src/mmap_type.rs
//! Typed memory maps //! //! This module adds type to directly map types and a slice of types onto a memory mapped file. //! The typed memory maps can be directly used as if it were that type. //! //! Types: //! - [`MmapType`] //! - [`MmapSlice`] //! - [`MmapBitSlice`] //! //! Various additional functions are added fo...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false
qdrant/qdrant
https://github.com/qdrant/qdrant/blob/f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd/lib/common/common/build.rs
lib/common/common/build.rs
fn main() { // Required for tango benchmarks, see: // https://github.com/bazhenov/tango/blob/v0.6.0/README.md#getting-started println!("cargo:rustc-link-arg-benches=-rdynamic"); println!("cargo:rerun-if-changed=build.rs"); }
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/tempfile_ext.rs
lib/common/common/src/tempfile_ext.rs
use std::ops::Deref; use std::path::{Path, PathBuf}; use tempfile::{PathPersistError, TempPath}; /// Either a temporary or a persistent path. #[must_use = "returns a TempPath, if dropped the downloaded file is deleted"] pub enum MaybeTempPath { Temporary(TempPath), Persistent(PathBuf), } impl MaybeTempPath {...
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/num_traits.rs
lib/common/common/src/num_traits.rs
//! Traits that should belong to the [`num-traits`] crate, but are missing. //! //! [`num-traits`]: https://crates.io/crates/num-traits use std::num::{NonZero, Saturating}; pub trait ConstBits { /// The size of this integer type in bits. const BITS: u32; } macro_rules! impl_const_bits { ($($t:ty),* $(,)?...
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_ordered.rs
lib/common/common/src/bitpacking_ordered.rs
//! A compression algorithm to store medium-to-large-sized sorted arrays of //! `u64` values. //! //! Allows for fast random access within the compressed data. //! //! Assumptions: //! - The input values are sorted. //! - The distribution of the values is somewhat uniform, i.e. there are no //! large gaps between val...
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/scope_tracker.rs
lib/common/common/src/scope_tracker.rs
use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; /// An RAII-style counter that tracks the number of active scopes. /// Internally uses a reference-counted value, allowing it to be freely cloned. #[derive(Default, Debug, Clone)] pub struct ScopeTracker { inner: Arc<AtomicUsize>, } impl ScopeTra...
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/bytes.rs
lib/common/common/src/bytes.rs
/// Convert number of bytes into human-readable format /// /// # Examples /// - 123 -> "123 B" /// - 1024 -> "1.00 KiB" /// - 1000000 -> "976.56 KiB" /// - 1048576 -> "1.00 MiB" pub fn bytes_to_human(bytes: usize) -> String { const UNITS: [&str; 9] = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]; ...
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/stable_hash.rs
lib/common/common/src/stable_hash.rs
use std::hash::{Hash, Hasher}; use bytemuck::TransparentWrapper; /// A hashable type, like [`Hash`], but with a stable/portable implementation. /// /// According to the [`Hash`] docs, its implementations for most standard /// library types should not considered stable across platforms or compiler /// versions. Neithe...
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/lib.rs
lib/common/common/src/lib.rs
pub mod bitpacking; pub mod bitpacking_links; pub mod bitpacking_ordered; pub mod budget; pub mod bytes; pub mod counter; pub mod cow; pub mod cpu; pub mod defaults; pub mod delta_pack; pub mod disk; pub mod either_variant; pub mod ext; pub mod fixed_length_priority_queue; pub mod flags; pub mod is_alive_lock; pub mod ...
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.rs
lib/common/common/src/bitpacking.rs
use num_traits::{AsPrimitive, ConstOne, PrimInt, Unsigned}; use crate::num_traits::ConstBits; /// The internal buffer type for [`BitWriter`] and [`BitReader`]. /// Instead of writing/reading a single byte at a time, they write/read /// `size_of::<Buf>()` bytes at once, for a better performance. /// This is an impleme...
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/ext.rs
lib/common/common/src/ext.rs
use bitvec::order::BitOrder; use bitvec::slice::BitSlice; use bitvec::store::BitStore; pub trait OptionExt { /// `replace` if the given `value` is `Some` fn replace_if_some(&mut self, value: Self); } impl<T> OptionExt for Option<T> { #[inline] fn replace_if_some(&mut self, value: Self) { if le...
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/mmap_hashmap.rs
lib/common/common/src/mmap_hashmap.rs
#[cfg(any(test, feature = "testing"))] use std::collections::{BTreeMap, BTreeSet}; use std::hash::Hash; use std::io::{self, Cursor, Write}; use std::marker::PhantomData; use std::mem::{align_of, size_of}; use std::path::Path; use std::str; use fs_err::File; use memmap2::Mmap; use memory::madvise::{AdviceSetting, Madvi...
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/typelevel.rs
lib/common/common/src/typelevel.rs
//! Type-level boolean and option types. //! //! A value of these traits can be used to conditionally enable or disable //! particular functions in generic contexts. Compared to using [`bool`] or //! [`Option`], there are no runtime checks, nor performance overhead, nor //! potential panics due to unwrapping an [`Optio...
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/rate_limiting.rs
lib/common/common/src/rate_limiting.rs
use std::time::{Duration, Instant}; /// A rate limiter based on the token bucket algorithm. /// Designed to limit the number of requests per minute. /// The bucket is refilled at a constant rate of `tokens_per_sec` tokens per second. /// The bucket has a maximum capacity of `capacity_per_minute` tokens to allow for bu...
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/math.rs
lib/common/common/src/math.rs
use crate::types::ScoreType; /// Acts as a substitute for sigmoid function, but faster because it doesn't do exponent. /// /// Range of output is (-1, 1) #[inline] pub fn fast_sigmoid(x: ScoreType) -> ScoreType { // from https://stackoverflow.com/questions/10732027/fast-sigmoid-algorithm x / (1.0 + x.abs()) } ...
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/validation.rs
lib/common/common/src/validation.rs
use std::borrow::Cow; use serde::Serialize; use validator::{Validate, ValidationError, ValidationErrors}; // Multivector should be small enough to fit the chunk of vector storage #[cfg(debug_assertions)] pub const MAX_MULTIVECTOR_FLATTENED_LEN: usize = 32 * 1024; #[cfg(not(debug_assertions))] pub const MAX_MULTIVEC...
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/is_alive_lock.rs
lib/common/common/src/is_alive_lock.rs
use std::sync::{Arc, Weak}; use parking_lot::{ArcMutexGuard, Mutex, RawMutex}; /// Structure which ensures that the lock is alive at the time of locking, /// and will prevent dropping while guarded. /// /// Dropping this structure will also mark as dead, preventing future access through any dangling /// handles. /// ...
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/panic.rs
lib/common/common/src/panic.rs
use std::any::Any; pub type Payload = dyn Any + Send + 'static; /// Downcast panic payload into a string. /// /// Downcast `&'static str` and `String` panic payloads into a `&str`. #[allow(clippy::borrowed_box)] // We *have to* use `&Box<dyn Any>`, because `Box<dyn Any>` implements `Any` itself, // so `downcast_str(&...
rust
Apache-2.0
f937d0260ffd7705c6f34d9c25da1e27ebf5ddfd
2026-01-04T15:34:51.524868Z
false