thomas-pfeiffer commented on code in PR #2993:
URL: https://github.com/apache/iceberg-python/pull/2993#discussion_r2841434811
##########
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.
Review Comment:
Minor detail, but I would keep these original comments. Or is there a
specific reason to remove them?
##########
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
Review Comment:
Minor detail, but I would keep these original comments. Or is there a
specific reason to remove them?
##########
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:
Is there a specific use case / scenario, where one would use this method?
It might be helpful to mention them here, as I assume in most cases, users
wouldn't ever call this method - except for very specific scenarios.
--
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]