-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area/storageStorage layer and backendsStorage layer and backendspriority/criticalMust be done first, blocks other workMust be done first, blocks other worksize/MMedium: 3-5 daysMedium: 3-5 daysstatus/readyReady to be picked upReady to be picked uptype/featureNew feature or functionalityNew feature or functionality
Description
Summary
Define the core Storage trait and associated error types that will be implemented by both local filesystem and cloud storage backends.
Parent Epic
- [Epic] Distributed Roboflow with Alibaba Cloud (OSS + ACK) #9 Distributed Roboflow with Alibaba Cloud
Dependencies
- Depends on: [Phase 1.1] Add core dependencies for storage abstraction #10 (Core dependencies)
Tasks
- Create
src/storage/mod.rsmodule file - Define
StorageErrorenum covering all failure modes:NotFound- Object does not existPermissionDenied- Access deniedAlreadyExists- Object already exists (for exclusive create)InvalidPath- Malformed path or URLNetworkError- Network connectivity issueTimeout- Operation timed outIoError- Wrapping std::io::ErrorOther- Catch-all with message
- Define
ObjectMetadatastruct with fields:size: u64last_modified: Option<chrono::DateTime<Utc>>content_type: Option<String>etag: Option<String>
- Define synchronous
Storagetrait with methods:fn reader(&self, path: &str) -> Result<Box<dyn Read + Send>, StorageError>fn writer(&self, path: &str) -> Result<Box<dyn Write + Send>, StorageError>fn exists(&self, path: &str) -> Result<bool, StorageError>fn size(&self, path: &str) -> Result<u64, StorageError>fn metadata(&self, path: &str) -> Result<ObjectMetadata, StorageError>fn list(&self, prefix: &str) -> Result<Vec<String>, StorageError>fn delete(&self, path: &str) -> Result<(), StorageError>fn copy(&self, from: &str, to: &str) -> Result<(), StorageError>
- Define
SeekableStorageextension trait for backends supporting seek - Implement
std::error::ErrorforStorageError - Implement
From<std::io::Error>forStorageError - Add module to
src/lib.rsexports - Write documentation for all public types
Acceptance Criteria
-
StorageErrorenum defined with all variants -
ObjectMetadatastruct defined -
Storagetrait defined with all methods -
SeekableStoragetrait defined - Error conversions implemented
- Module exported in
src/lib.rs - All public items documented
- Code compiles without warnings
Files to Create/Modify
src/storage/mod.rs(new)src/storage/error.rs(new, optional - can be in mod.rs)src/lib.rs(add module export)
Design Notes
- Trait uses synchronous API to minimize changes to existing code
Box<dyn Read/Write>allows flexibility in implementation- Cloud backends will use internal tokio runtime for blocking
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/storageStorage layer and backendsStorage layer and backendspriority/criticalMust be done first, blocks other workMust be done first, blocks other worksize/MMedium: 3-5 daysMedium: 3-5 daysstatus/readyReady to be picked upReady to be picked uptype/featureNew feature or functionalityNew feature or functionality