jacinle.storage.kv.memcached#
Classes
A memcached-based key-value store. |
Class MemcachedKVStore
- class MemcachedKVStore[source]#
Bases:
KVStoreBase
A memcached-based key-value store.
- __new__(**kwargs)#
- erase(key, **kwargs)#
Erase the key from the KVStore.
- Parameters:
key – the key.
- get(key, default=None, **kwargs)#
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)#
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.
- transaction(*args, **kwargs)#
Create a transaction context.
- update(key, value, **kwargs)#
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 connection#
The connection to the memcached server.
- property readonly#
Whether the KVStore is readonly.