kris-gaudel commented on code in PR #2993:
URL: https://github.com/apache/iceberg-python/pull/2993#discussion_r2871192844
##########
pyiceberg/manifest.py:
##########
@@ -891,13 +892,16 @@ def __hash__(self) -> int:
return hash(self.manifest_path)
-# Global cache for ManifestFile objects, keyed by manifest_path.
-# This deduplicates ManifestFile objects across manifest lists, which commonly
-# share manifests after append operations.
-_manifest_cache: LRUCache[str, ManifestFile] = LRUCache(maxsize=128)
-
-# Lock for thread-safe cache access
+_DEFAULT_MANIFEST_CACHE_SIZE = 128
+_manifest_cache_size = Config().get_int("manifest-cache-size") or
_DEFAULT_MANIFEST_CACHE_SIZE
_manifest_cache_lock = threading.RLock()
+_manifest_cache: LRUCache[str, ManifestFile] =
LRUCache(maxsize=_manifest_cache_size)
+
+
+def clear_manifest_cache() -> None:
+ """Clear the manifest cache."""
Review Comment:
https://github.com/apache/iceberg-python/issues/2325
When I was working though this issue I vaguely recalled someone suggesting
the idea of a public function to disable it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]