Shortcuts

LmdbBackend

class mmengine.fileio.LmdbBackend(db_path, readonly=True, lock=False, readahead=False, **kwargs)[source]

Lmdb storage backend.

Parameters:
  • db_path (str) – Lmdb database path.

  • readonly (bool) – Lmdb environment parameter. If True, disallow any write operations. Defaults to True.

  • lock (bool) – Lmdb environment parameter. If False, when concurrent access occurs, do not lock the database. Defaults to False.

  • readahead (bool) – Lmdb environment parameter. If False, disable the OS filesystem readahead mechanism, which may improve random read performance when a database is larger than RAM. Defaults to False.

  • **kwargs – Keyword arguments passed to lmdb.open.

db_path

Lmdb database path.

Type:

str

get(filepath)[source]

Get values according to the filepath.

Parameters:

filepath (str or Path) – Here, filepath is the lmdb key.

Returns:

Expected bytes object.

Return type:

bytes

Examples

>>> backend = LmdbBackend('path/to/lmdb')
>>> backend.get('key')
b'hello world'
Read the Docs v: latest
Versions
latest
stable
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.