Get values according to the filepath from one lmdb named client_key. Args: filepath (str | obj:`Path`): Here, filepath is the lmdb key. client_key (str): Used for distinguishing different lmdb envs.
(self, filepath, client_key)
| 112 | self._client[client] = lmdb.open(path, readonly=readonly, lock=lock, readahead=readahead, **kwargs) |
| 113 | |
| 114 | def get(self, filepath, client_key): |
| 115 | """Get values according to the filepath from one lmdb named client_key. |
| 116 | |
| 117 | Args: |
| 118 | filepath (str | obj:`Path`): Here, filepath is the lmdb key. |
| 119 | client_key (str): Used for distinguishing different lmdb envs. |
| 120 | """ |
| 121 | filepath = str(filepath) |
| 122 | assert client_key in self._client, (f'client_key {client_key} is not in lmdb clients.') |
| 123 | client = self._client[client_key] |
| 124 | with client.begin(write=False) as txn: |
| 125 | value_buf = txn.get(filepath.encode('ascii')) |
| 126 | return value_buf |
| 127 | |
| 128 | def get_text(self, filepath): |
| 129 | raise NotImplementedError |