crepererum commented on issue #2230:
URL: https://github.com/apache/arrow-rs/issues/2230#issuecomment-1200902364
My 2 cents regarding path vs URL/URI:
The address of an object within a store is relative, i.e. a path (or a path
segment if you want) but a URL/URI is absolute. It is semantically kinda weird
that a single object store (e.g. an S3 store configured for one account+bucket)
answers URL-based requests. I think if you want something that abstracts over
multiple stores, we should introduce another layer on top, e.g.:
```rust
trait ObjectStoreRegistry {
fn register(&mut self, name: &str, store: Arc<dyn ObjectStore>);
fn map(&self, url: Url) -> Option<(Arc<dyn ObjectStore> Path)>;
}
// usage
let mut registry = make_registry();
registry.register("s3_prod", make_store(...));
registry.register("s3_dev", make_store(...));
registry.register("local", make_store(...));
let (store, path) = registry.map("s3_dev://my/file.parquet".into()).unwrap();
store.get(path)...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]