This class implements a Zarr abstract store. It provides the
basic plumbing for specific implementations of a Zarr store. It implements
the Zarr abstract store interface, with some extensions from the Python
zarr.abc.store.Store abstract class. Functions set_partial_values() and
get_partial_values() are not implemented.
friendlyClassName(read-only) Name of the class for printing.
read_only(read-only) Flag to indicate if the store is read-only.
supports_consolidated_metadataFlag to indicate if the store can consolidate metadata.
supports_deletesFlag to indicate if keys and arrays can be deleted.
supports_listingFlag to indicate if the store can list its keys.
supports_partial_writesDeprecated, always FALSE.
supports_writesFlag to indicate if the store can write data.
version(read-only) The Zarr version of the store.
separator(read-only) The default separator between elements of chunks of arrays in the store. Every store typically has a default which is used when creating arrays. The actual chunk separator being used is determined by looking at the "chunk_key_encoding" attribute of each array.
new()Create an instance of this class. Since this class is "abstract", it should not be instantiated directly - it is intended to be called by descendant classes, exclusively.
zarr_store$new(read_only = FALSE, version = 3L)read_onlyFlag to indicate if the store is read-only. Default
FALSE.
versionThe version of the Zarr store. By default this is 3.
An instance of this class.
clear()Clear the store. Remove all keys and values from the store.
zarr_store$clear()Self, invisibly.
erase()Remove a key from the store. This method is part of the abstract store interface in ZEP0001.
zarr_store$erase(key)keyCharacter string. The key to remove from the store.
Self, invisibly.
erase_prefix()Remove all keys and prefixes in the store that begin with a given prefix. This method is part of the abstract store interface in ZEP0001.
zarr_store$erase_prefix(prefix)prefixCharacter string. The prefix to groups or arrays to remove from the store, including in child groups.
Self, invisibly.
keyCharacter string. The key that the store will be searched for.
TRUE if argument key is found, FALSE otherwise.
get()Retrieve the value associated with a given key. This method is part of the abstract store interface in ZEP0001.
zarr_store$get(key, prototype, byte_range)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.
An raw vector of data, or NULL if no data was found.
getsize()Return the size, in bytes, of a value in a Store.
zarr_store$getsize(key)keyCharacter string. The key whose length will be returned.
The size, in bytes, of the object.
getsize_prefix()Return the size, in bytes, of all objects found under the group indicated by the prefix.
zarr_store$getsize_prefix(prefix)prefixCharacter string. The prefix to groups to scan.
The size, in bytes, of all the objects under a group, as a single integer value.
is_empty()Is the group empty?
zarr_store$is_empty(prefix)prefixCharacter string. The prefix to the group to scan.
TRUE is the group indicated by argument prefix has no
sub-groups or arrays, FALSE otherwise.
list()Retrieve all keys in the store. This method is part of the abstract store interface in ZEP0001.
zarr_store$list()A character vector with all keys found in the store, both for groups and arrays.
list_dir()Retrieve all keys and prefixes with a given prefix and which do not contain the character "/" after the given prefix. This method is part of the abstract store interface in ZEP0001.
zarr_store$list_dir(prefix)prefixCharacter string. The prefix to groups to list.
A list with all keys found in the store immediately below the
prefix, both for groups and arrays.
list_prefix()Retrieve all keys and prefixes with a given prefix. This method is part of the abstract store interface in ZEP0001.
zarr_store$list_prefix(prefix)prefixCharacter string. The prefix to groups to list.
A character vector with all fully-qualified keys found in the store, both for groups and arrays.
set()Store a (key, value) pair.
zarr_store$set(key, value)keyThe key whose value to set.
valueThe value to set, typically a chunk of data.
Self, invisibly.
set_if_not_exists()Store a key to argument value if the key is not already
present. This method is part of the abstract store interface in
ZEP0001.
zarr_store$set_if_not_exists(key, value)keyThe key whose value to set.
valueThe value to set, typically an R array.
Self, invisibly.
get_metadata()Retrieve the metadata document of the node at the location
indicated by the prefix argument.
zarr_store$get_metadata(prefix)prefixThe prefix of the node whose metadata document to retrieve.
set_metadata()Set the metadata document of the node at the location
indicated by the prefix argument. This is a no-op for stores that
have no writing capability. Other stores must override this method.
zarr_store$set_metadata(prefix, metadata)prefixThe prefix of the node whose metadata document to set.
metadataThe metadata to persist, either a list or an instance
of array_builder.
Self, invisible.
create_group()Create a new group in the store under the specified path to
the parent argument. The parent path must point to a Zarr group.
zarr_store$create_group(parent, name)parentThe path to the parent group of the new group.
nameThe name of the new group.
A list with the metadata of the group, or an error if the group could not be created.
create_array()Create a new array in the store under the specified path to
the parent argument. The parent path must point to a Zarr group.
zarr_store$create_array(parent, name)parentThe path to the parent group of the new array.
nameThe name of the new array.
A list with the metadata of the array, or an error if the array could not be created.
https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#abstract-store-interface