KeyValueStoreClient
Hierarchy
Index
Methods
delete_value
Delete a value from the key-value store by its key.
The backend method for the
KeyValueStore.delete_valuecall.Parameters
keyword-onlykey: str
Returns None
drop
Drop the whole key-value store and remove all its values.
The backend method for the
KeyValueStore.dropcall.Returns None
get_metadata
Get the metadata of the key-value store.
Returns KeyValueStoreMetadata
get_public_url
Get the public URL for the given key.
The backend method for the
KeyValueStore.get_public_urlcall.Parameters
keyword-onlykey: str
Returns str
get_value
Retrieve the given record from the key-value store.
The backend method for the
KeyValueStore.get_valuecall.Parameters
keyword-onlykey: str
Returns KeyValueStoreRecord | None
iterate_entries
Iterate over all the existing records in the key-value store, including their values.
The backend method for the
KeyValueStore.iterate_entriesandKeyValueStore.iterate_valuescalls.The default implementation lists the keys with
iterate_keysand reads each value separately withget_valueas the iteration advances, so only a single value is held in memory at a time. Whether a record deleted while the iteration is in progress is yielded depends on the implementation. Backends that can read the keys together with their values more efficiently should override this method; such an implementation must still keep the memory usage bounded, e.g. by streaming or by batching on the known record sizes.Parameters
optionalkeyword-onlyexclusive_start_key: str | None = None
optionalkeyword-onlylimit: int | None = None
Returns AsyncIterator[KeyValueStoreRecord]
iterate_keys
Iterate over all the existing keys in the key-value store.
The backend method for the
KeyValueStore.iterate_keyscall.Parameters
optionalkeyword-onlyexclusive_start_key: str | None = None
optionalkeyword-onlylimit: int | None = None
Returns AsyncIterator[KeyValueStoreRecordMetadata]
purge
Purge all items from the key-value store.
The backend method for the
KeyValueStore.purgecall.Returns None
record_exists
Check if a record with the given key exists in the key-value store.
The backend method for the
KeyValueStore.record_existscall.Parameters
keyword-onlykey: str
The key to check for existence.
Returns bool
True if a record with the given key exists, False otherwise.
set_value
Set a value in the key-value store by its key.
The backend method for the
KeyValueStore.set_valuecall.Parameters
keyword-onlykey: str
keyword-onlyvalue: Any
optionalkeyword-onlycontent_type: str | None = None
Returns None
An abstract class for key-value store (KVS) storage clients.
Key-value stores clients provide an interface for accessing and manipulating KVS storage. They handle operations like getting, setting, deleting KVS values across different storage backends.
Storage clients are specific to the type of storage they manage (
Dataset,KeyValueStore,RequestQueue), and can operate with various storage systems including memory, file system, databases, and cloud storage solutions.This abstract class defines the interface that all specific KVS clients must implement.