Repository navigation
feat(universal_io): add read_whole and read_json_via for config files - #8251
Merged
Merged
Conversation
- Extend UniversalRead with read_whole() for single-access whole-file read - Default impl uses len() + read(0..len()); MmapUniversal overrides with one slice - Add UniversalIoError::SerdeJson for JSON deserialization errors - Add read_json_via<S,T>(path, options) in common::universal_io - Gridstore: use read_json_via for config in read_config_and_tracker - Segment: use read_json_via in ChunkedVectors::load_config, handle NotFound - Segment: extend From<UniversalIoError> for OperationError with SerdeJson variant Made-with: Cursor
- Add NotFound { path } variant so callers can match without io::ErrorKind
- MmapUniversal::open maps io::ErrorKind::NotFound to NotFound { path }
- ChunkedVectors::load_config matches NotFound => Ok(None)
- OperationError From<UniversalIoError> handles NotFound
Made-with: Cursor
Made-with: Cursor
Use &bytes instead of &*bytes; auto-deref handles Cow Made-with: Cursor
xzfc
approved these changes
Mar 2, 2026
coszio
pushed a commit
to coszio/qdrant
that referenced
this pull request
Mar 5, 2026
Introduce a universal I/O abstraction layer (following upstream qdrant/qdrant PRs qdrant#8196, qdrant#8251, qdrant#8292) that decouples data access from storage backends. Key components: - UniversalRead<T> / UniversalWrite<T> traits for backend-agnostic I/O - MmapUniversal<T>: mmap-based implementation with optional sequential read mmap - BitSliceReader<S>: storage-agnostic bitslice reader that works over any UniversalRead<u8> backend, supporting: - read_bitslice(): read entire storage as a BitSlice (zero-copy for mmap) - get_bit(): single-bit access translating bit offset to a 1-byte read - read_bit_range(): partial bit range reads with byte-aligned backend access https://claude.ai/code/session_01X9Bnj9Gooxh5bxkhbFmnGx
generall
added a commit
that referenced
this pull request
Mar 26, 2026
…#8251) * feat(universal_io): add read_whole and read_json_via for config files - Extend UniversalRead with read_whole() for single-access whole-file read - Default impl uses len() + read(0..len()); MmapUniversal overrides with one slice - Add UniversalIoError::SerdeJson for JSON deserialization errors - Add read_json_via<S,T>(path, options) in common::universal_io - Gridstore: use read_json_via for config in read_config_and_tracker - Segment: use read_json_via in ChunkedVectors::load_config, handle NotFound - Segment: extend From<UniversalIoError> for OperationError with SerdeJson variant Made-with: Cursor * feat(universal_io): add UniversalIoError::NotFound for file-not-found - Add NotFound { path } variant so callers can match without io::ErrorKind - MmapUniversal::open maps io::ErrorKind::NotFound to NotFound { path } - ChunkedVectors::load_config matches NotFound => Ok(None) - OperationError From<UniversalIoError> handles NotFound Made-with: Cursor * style: apply cargo fmt Made-with: Cursor * fix(common): satisfy clippy explicit_auto_deref in read_json_via Use &bytes instead of &*bytes; auto-deref handles Cow Made-with: Cursor --------- Co-authored-by: Cursor Agent <[email protected]>
KShivendu
pushed a commit
that referenced
this pull request
Mar 30, 2026
…#8251) * feat(universal_io): add read_whole and read_json_via for config files - Extend UniversalRead with read_whole() for single-access whole-file read - Default impl uses len() + read(0..len()); MmapUniversal overrides with one slice - Add UniversalIoError::SerdeJson for JSON deserialization errors - Add read_json_via<S,T>(path, options) in common::universal_io - Gridstore: use read_json_via for config in read_config_and_tracker - Segment: use read_json_via in ChunkedVectors::load_config, handle NotFound - Segment: extend From<UniversalIoError> for OperationError with SerdeJson variant Made-with: Cursor * feat(universal_io): add UniversalIoError::NotFound for file-not-found - Add NotFound { path } variant so callers can match without io::ErrorKind - MmapUniversal::open maps io::ErrorKind::NotFound to NotFound { path } - ChunkedVectors::load_config matches NotFound => Ok(None) - OperationError From<UniversalIoError> handles NotFound Made-with: Cursor * style: apply cargo fmt Made-with: Cursor * fix(common): satisfy clippy explicit_auto_deref in read_json_via Use &bytes instead of &*bytes; auto-deref handles Cow Made-with: Cursor --------- Co-authored-by: Cursor Agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends universal io so gridstore and segment can read JSON configs through the same interface as other file I/O.
len()+read(0..len());MmapUniversaloverrides to return the full slice in one go (avoids two storage accesses).common::universal_iothat opens withS, callsread_whole(), thenserde_json::from_slice.read_config_and_trackernow usesread_json_viainstead ofFile::open+BufReader+serde_json::from_reader.ChunkedVectors::load_configusesread_json_via;NotFoundis mapped toOk(None).From\<UniversalIoError\>forOperationErrorextended withSerdeJsonvariant.Config write is unchanged (still
atomic_save_jsonin common::fs).Made with Cursor