jacinle.storage.kv.base#
Classes
The base class for all key-value stores. |
Class KVStoreBase
- class KVStoreBase[source]#
Bases:
object
The base class for all key-value stores.
- __init__(readonly=False)[source]#
Initialize the KVStore.
- Parameters:
readonly (bool) – If True, the KVStore is readonly.
- __new__(**kwargs)#
- get(key, default=None, **kwargs)[source]#
Get the value of the key.
- Parameters:
key – the key.
default – the default value if the key does not exist.
- put(key, value, replace=True, **kwargs)[source]#
Put the value of the key. If the key already exists, the value will be replaced if replace is True.
- Parameters:
key – the key.
value – the value.
replace (bool) – whether to replace the value if the key already exists.
- update(key, value, **kwargs)[source]#
Update the value of the key. If the key does not exist, the value will be put.
- Parameters:
key – the key.
value – the value.
- property readonly#
Whether the KVStore is readonly.