Developing new storage backends
One advantage of the zarr data model is that it can be used in combination with a variety of storage backends. Currently in this package there is support for a DictStore
(keeping data in memory), DirectoryStore
(writing data to a local disk) and an S3Store
for S3-compatible object store which is currently read-only. In order to implement a new storage backend, you would have to create a subtype of Zarr.AbstractStore
and implement the following methods:
Zarr.storagesize
— Functionstoragesize(d::AbstractStore, p::AbstractString)
This function shall return the size of all data files in a store at path p
.
Base.getindex
— MethodBase.getindex(d::AbstractStore,i::String)
Returns the data stored in the given key as a Vector{UInt8}
Base.setindex!
— MethodBase.setindex!(d::AbstractStore,v,i::String)
Writes the values in v to the given store and key.
Zarr.subdirs
— Functionsubdirs(d::AbstractStore, p)
Returns a list of keys for children stores in the given store at path p.
You can get some inspiration on how to implement this by looking at the source code of existing storage backends.