@@ -1333,6 +1333,95 @@ cdef class Archive:
13331333 except RuntimeError as e:
13341334 raise KeyError(str(e))
13351335
1336+ @property
1337+ def cluster_cache_max_size(self) -> pyint:
1338+ """ Maximum size of the cluster cache.
1339+
1340+ Returns:
1341+ (int ): maximum number of clusters stored in the cache.
1342+ """
1343+ return self.c_archive.getClusterCacheMaxSize()
1344+
1345+ @cluster_cache_max_size.setter
1346+ def cluster_cache_max_size(self, nb_clusters: pyint):
1347+ """ Set the size of the cluster cache.
1348+
1349+ If the new size is lower than the number of currently stored clusters
1350+ some clusters will be dropped from cache to respect the new size.
1351+
1352+ Args:
1353+ nb_clusters (int ): maximum number of clusters stored in the cache
1354+ """
1355+
1356+ self.c_archive.setClusterCacheMaxSize(nb_clusters)
1357+
1358+ @property
1359+ def cluster_cache_current_size(self) -> pyint:
1360+ """ Size of the cluster cache.
1361+
1362+ Returns:
1363+ (int ): number of clusters currently stored in the cache.
1364+ """
1365+ return self.c_archive.getClusterCacheCurrentSize()
1366+
1367+ @property
1368+ def dirent_cache_max_size(self) -> pyint:
1369+ """ Maximum size of the dirent cache.
1370+
1371+ Returns:
1372+ (int ): maximum number of dirents stored in the cache.
1373+ """
1374+ return self.c_archive.getDirentCacheMaxSize()
1375+
1376+ @dirent_cache_max_size.setter
1377+ def dirent_cache_max_size(self, nb_dirents: pyint):
1378+ """ Set the size of the dirent cache.
1379+
1380+ If the new size is lower than the number of currently stored dirents
1381+ some dirents will be dropped from cache to respect the new size.
1382+
1383+ Args:
1384+ nb_dirents (int ): maximum number of dirents stored in the cache.
1385+ """
1386+ self.c_archive.setDirentCacheMaxSize(nb_dirents)
1387+
1388+ @property
1389+ def dirent_cache_current_size(self) -> pyint:
1390+ """ Size of the dirent cache.
1391+
1392+ Returns:
1393+ (int ): number of dirents currently stored in the cache.
1394+ """
1395+ return self.c_archive.getDirentCacheCurrentSize()
1396+
1397+ @property
1398+ def dirent_lookup_cache_max_size(self) -> pyint:
1399+ """ Size of the dirent lookup cache.
1400+
1401+ The returned size returns the default size or the last set size.
1402+ This may not correspond to the actual size of the dirent lookup cache.
1403+ See set_dirent_lookup_cache_max_size for more information.
1404+
1405+ Returns:
1406+ (int ): maximum number of sub ranges created in the lookup cache.
1407+ """
1408+ return self.c_archive.getDirentLookupCacheMaxSize()
1409+
1410+ @dirent_lookup_cache_max_size.setter
1411+ def dirent_lookup_cache_max_size(self, nb_ranges: pyint):
1412+ """ Set the size of the dirent lookup cache.
1413+
1414+ Contrary to other set_< foo> _cache_max_size, this method is useless
1415+ once the lookup cache is created.
1416+ The lookup cache is created at first access to a entry in the archive.
1417+ So this method must be called before any access to content (including metadata).
1418+ It is best to call this method first, just after the archive creation.
1419+
1420+ Args:
1421+ nb_ranges (int ): maximum number of sub ranges created in the lookup cache.
1422+ """
1423+ self.c_archive.setDirentLookupCacheMaxSize(nb_ranges)
1424+
13361425 def __repr__(self) -> str:
13371426 return f"{self.__class__.__name__}(filename={self.filename})"
13381427
0 commit comments