private IList <ContentHashWithLastAccessTimeAndReplicaCount> GetUnpinnedHashesAndCompilePinnedSize( Context context, IEnumerable <ContentHashWithLastAccessTimeAndReplicaCount> hashesToPurge, PinnedSizeChecker pinnedSizeChecker, PurgeResult purgeResult) { long totalPinnedSize = 0; // Compile aggregate pinnedSize for the fail faster case var unpinnedHashes = new List <ContentHashWithLastAccessTimeAndReplicaCount>(); foreach (var hashInfo in hashesToPurge) { var pinnedSize = pinnedSizeChecker(context, hashInfo.ContentHash); if (pinnedSize >= 0) { totalPinnedSize += pinnedSize; } else { unpinnedHashes.Add(hashInfo); } } purgeResult.MergePinnedSize(totalPinnedSize); return(unpinnedHashes); }
private IList <ContentHashWithLastAccessTimeAndReplicaCount> GetUnpinnedHashesAndCompilePinnedSize(IEnumerable <ContentHashWithLastAccessTimeAndReplicaCount> purgeableHashesBatch) { long totalPinnedSize = 0; // Compile aggregate pinnedSize for the fail faster case var unpinnedHashes = new List <ContentHashWithLastAccessTimeAndReplicaCount>(); foreach (var hashInfo in purgeableHashesBatch) { var pinnedSize = _distributedEvictionSettings.PinnedSizeChecker(_context, hashInfo.ContentHash); if (pinnedSize >= 0) { totalPinnedSize += pinnedSize; } else { unpinnedHashes.Add(hashInfo); } } _purgeResult.MergePinnedSize(totalPinnedSize); return(unpinnedHashes); }