internal async Task <EvictResult> EvictContentAsync(Context context, ContentHashWithLastAccessTimeAndReplicaCount contentHashInfo, bool onlyUnlinked) { var evictResult = await _store.EvictAsync(context, contentHashInfo, onlyUnlinked, evicted : null); if (evictResult.SuccessfullyEvictedHash) { OnContentEvicted(evictResult.EvictedSize); } return(evictResult); }
private bool IsPassEvictionAge(Context context, ContentHashWithLastAccessTimeAndReplicaCount candidate, TimeSpan evictionMinAge, int index, ref int evictionCount) { if (candidate.Age(_clock) >= evictionMinAge) { evictionCount++; return(true); } context.Debug($"Previous successful eviction attempts = {evictionCount}, Total eviction attempts previously = {index}, minimum eviction age = {evictionMinAge.ToString()}, pool size = {_configuration.EvictionPoolSize}." + $" Candidate replica count = {candidate.ReplicaCount}, effective age = {candidate.EffectiveAge(_clock)}, age = {candidate.Age(_clock)}."); return(false); }
/// <inheritdoc /> protected internal override Task <EvictResult> EvictContentAsync(Context context, ContentHashWithLastAccessTimeAndReplicaCount contentHashInfo, bool onlyUnlinked) { return(_store.EvictAsync(context, contentHashInfo, onlyUnlinked, Evicted)); }
public Task <EvictResult> EvictAsync(Context context, ContentHashWithLastAccessTimeAndReplicaCount contentHashInfo, bool onlyUnlinked, Action <long> evicted) { throw new NotImplementedException(); }
/// <nodoc /> protected internal abstract Task <EvictResult> EvictContentAsync( Context context, ContentHashWithLastAccessTimeAndReplicaCount contentHashInfo, bool onlyUnlinked);
/// <summary> /// Initializes a new instance of the <see cref="EvictResult"/> class. /// </summary> public EvictResult(ContentHashWithLastAccessTimeAndReplicaCount contentHash, long evictedSize, long evictedFiles, long pinnedSize, bool successfullyEvictedHash) : this(evictedSize, evictedFiles, pinnedSize, contentHash.LastAccessTime, contentHash.EffectiveLastAccessTime, successfullyEvictedHash, contentHash.ReplicaCount) { }