If the item is not found in the lmdb file, resolves to the persistent cache default behaviour.
(self, item_transformed)
| 695 | return lmdb.open(path=f"{self.db_file}", subdir=False, **self.lmdb_kwargs) |
| 696 | |
| 697 | def _cachecheck(self, item_transformed): |
| 698 | """If the item is not found in the lmdb file, resolves to the persistent cache default behaviour.""" |
| 699 | if self._read_env is None: |
| 700 | # this runs on multiple processes, each one should have its own env. |
| 701 | self._read_env = self._fill_cache_start_reader(show_progress=False) |
| 702 | with self._read_env.begin(write=False) as txn: |
| 703 | data = txn.get(self.hash_func(item_transformed)) |
| 704 | if data is None: |
| 705 | warnings.warn("LMDBDataset: cache key not found, running fallback caching.") |
| 706 | return super()._cachecheck(item_transformed) |
| 707 | try: |
| 708 | # return pickle.loads(data) |
| 709 | return self._safe_deserialize(data) |
| 710 | except Exception as err: |
| 711 | raise RuntimeError("Invalid cache value, corrupted lmdb file?") from err |
| 712 | |
| 713 | def info(self): |
| 714 | """ |
nothing calls this directly
no test coverage detected