-
Notifications
You must be signed in to change notification settings - Fork 24
Make KeyValueAccess "rooted" #209
Description
We are in a slightly weird situation currently:
There is only one FileSystemKeyValueAccess for all datasets on local (or mounted) file systems,
but there are many AmazonS3KeyValueAccess (for example), typically one per dataset.
(Also the cloud KVAs contain bucket which I would consider part of the dataset URI, while file system KVA doesn't have anything like that.)
Both @cmhulbert and me were thinking about having more than one file system KVA.
Most recently, this came up in the context of file locking behaviour (#204).
It would be nice to be able to configure an IoPolicy per Dataset.
I think that we should explore a design where KeyValueAccess always contains a containerRoot.
All keys would be relative to this. I think this would simplify typical usage a lot.
Caveat: If we make this change, there should be a way of constructing a KeyValueAccess directly, because it is used externally.
For example https://github.com/JaneliaSciComp/multiview-reconstruction uses it to access XML files (that are stored outside the dataset root).
(JaneliaSciComp/multiview-reconstruction#61 was when I last ran into this KVA weirdness)
It would be nice if the N5Factory conveniences would be available for creating KeyValueAccess (rooted at a given URI).
Maybe it should also be possible to get a new KeyValueAccess at a relative path with respect to an existing one?