mirror of
https://github.com/qdrant/qdrant.git
synced 2026-07-27 05:01:08 -05:00
* feat: add edge shard optimize * feat: refactor edge optimize logic * chore: remove unused &self * feat: add more tests * fix: linter * fix: missing threshold prop * fix: local nightly version * fix: linter * fix: linter issues * fix: use of explicit from * feat: add some notes * fix: feature_flags call once * [manual] review refactor * fix: - default_segment_number -> move shard - rename: default_hnsw_config -> hnsw_config - infer existing hnsw_config * feat: add optimize to python * feat: add python optimize example * feat: add hnsw config load tests * fix: linter * feat: make unified build config * fix: linter * fix: openapi definition' * fix: review comments * fix: remove mut self & reset_temp_segments_dir * fix: linter * review: rename for simpler public name + use explicit strucuture deconstruction * clipy --------- Co-authored-by: generall <andrey@vasnetsov.com>
27 lines
702 B
Rust
27 lines
702 B
Rust
use edge::EdgeShard;
|
|
use segment::common::operation_error::OperationError;
|
|
|
|
use crate::{PyEdgeShard, PyError};
|
|
|
|
impl PyEdgeShard {
|
|
pub fn get_shard(&self) -> Result<&EdgeShard, PyError> {
|
|
if let Some(shard) = &self.0 {
|
|
Ok(shard)
|
|
} else {
|
|
Err(PyError::from(OperationError::service_error(
|
|
"Shard is not initialized",
|
|
)))
|
|
}
|
|
}
|
|
|
|
pub fn get_shard_mut(&mut self) -> Result<&mut EdgeShard, PyError> {
|
|
if let Some(shard) = &mut self.0 {
|
|
Ok(shard)
|
|
} else {
|
|
Err(PyError::from(OperationError::service_error(
|
|
"Shard is not initialized",
|
|
)))
|
|
}
|
|
}
|
|
}
|