minos.common.storage.lmdb module¶
- class minos.common.storage.lmdb.MinosStorageLmdb(env, protocol=<class 'minos.common.protocol.avro.databases.MinosAvroDatabaseProtocol'>, **kwargs)[source]¶
Bases:
minos.common.storage.abc.MinosStorage
Minos Storage LMDB class
- __init__(env, protocol=<class 'minos.common.protocol.avro.databases.MinosAvroDatabaseProtocol'>, **kwargs)[source]¶
- add(table, key, value)[source]¶
Store a value.
- Parameters
table (
str
) – Table in which the data is stored.key (
str
) – Key that identifies the data.value (
typing.Any
) – Data to be stored.
- Return type
None
- Returns
This method does not return anything.
- classmethod build(path, max_db=10, map_size=1000000000, **kwargs)[source]¶
Build a new instance.
- Parameters
path (
typing.Union
[str
,pathlib.Path
]) – Path in which the database is stored.max_db (
int
) – Maximum number of available databases.map_size (
int
) – Maximum number of entries to be stored on the database. Default set to 1GBkwargs – Additional named arguments.
- Return type
- Returns
A
MinosStorageLmdb
instance.
- delete(table, key)[source]¶
Delete the stored value.
- Parameters
table (
str
) – Table in which the data is stored.key (
str
) – Key that identifies the data.
- Return type
None
- Returns
This method does not return anything.