Repository navigation
ZarrPixelsService: store the Zarr group into the cache - #64
Conversation
This updates the ZarrPixelsService to store the Zarr multiscale groups rather than their metadata only into the configurable cache. The pixel buffer can retrieve additional information including the Zarr format version and access the group attributes via the metadata() API. The static Zarr group and array opening methods are also updated to try versioned calls directly to reduce the number of calls.
chris-allan
left a comment
There was a problem hiding this comment.
I don't really see a reason why this should not go in nearly as is. Especially with the zarr-java design decision to guarantee that the opening of a Group or Array includes node metadata (regardless of whether it's zarr v2 or v3). Caching the node rather than the metadata map is just superior in almost every way.
Adding ZarrException to the public method prototypes did give me some pause but we have precedent doing that with BfPixelBuffer and FormatException.
Creating our own version of Group.open() and Array.open() also makes sense here as it avoids the two .exists() calls that currently happen in each of those static methods.
The current usage of getZarrPath only returns the Zarr group (v2 or v3) associated with the root path at which the store handle is initialized. If future iterations need to resolve groups deeper in the hierarchy, this API can be updated to handle a subpath.
chris-allan
left a comment
There was a problem hiding this comment.
Good improvement and foundation for the additional changes that need to happen.
Updates the ZarrPixelsService to store the Zarr multiscale groups rather than their metadata only into the configurable cache. The pixel buffer can retrieve additional information including the Zarr format version and access the group attributes via the metadata() API.
The static Zarr group and array opening methods are also updated to try versioned calls directly to reduce the number of calls.