This class implements a Zarr store in RAM memory. With this class Zarr stores can be read and written to. Obviously, any data is not persisted after the memory store is de-referenced and garbage-collected.
All data is stored in a list. The Zarr array itself has a list with the metadata, its chunks have names like "c.0.0.0" and they have an R array-like value.
This class performs no sanity checks on any of the arguments passed to the methods, for performance reasons. Since this class should be accessed through group and array objects, it is up to that code to ensure that arguments are valid, in particular keys and prefixes.
Super class
zarr::zarr_store -> zarr_memorystore
Active bindings
friendlyClassName(read-only) Name of the class for printing.
separator(read-only) The separator of the memory store, always a dot '.'.
keys(read-only) The defined keys in the store.
Methods
Method exists()
Check if a key exists in the store. The key can point to a group, an array (having a metadata list as its value) or a chunk.
Method clear()
Clear the store. Remove all keys and values from the store. Invoking this method deletes all data and this action can not be undone.
Method erase()
Remove a key from the store. The key must point to an array or a chunk. If the key points to an array, the key and all of subordinated keys are removed.
Method erase_prefix()
Remove all keys in the store that begin with a given prefix.
Method list_dir()
Retrieve all keys with a given prefix and which do not contain the character "/" after the given prefix. In other words, this retrieves all the keys in the store below the key indicated by the prefix.
Method set()
Store a (key, value) pair. If the value exists, it will
be overwritten.
Method get()
Retrieve the value associated with a given key.
Arguments
keyCharacter string. The key for which to get data.
prototypeIgnored. The only buffer type that is supported maps directly to an R raw vector.
byte_rangeIf
NULL, all data associated with the key is retrieved. If a single positive integer, all bytes starting from a given byte offset to the end of the object are returned. If a single negative integer, the final bytes are returned. If an integer vector of length 2, request a specific range of bytes where the end is exclusive. If the range ends after the end of the object, the entire remainder of the object will be returned. If the given range is zero-length or starts after the end of the object, an error will be returned.
Method get_metadata()
Retrieve the metadata document at the location indicated by
the prefix argument.
Method create_group()
Create a new group in the store under the specified path.
Method create_array()
Create a new array in the store under key constructed from
the specified path to the parent argument and the name. The key may
not already exist in the store.
Arguments
parentThe path to the parent group of the new array. This is ignored if the
nameargument is the empty string.nameThe name of the new array.
metadataA
listwith the metadata for the array. The list has to be valid for array construction. Use the array_builder class to create and or test for validity. An element "chunk_key_encoding" will be added to the metadata if it not already there or contains an invalid separator.