Beispiel #1
0
        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);
        }
Beispiel #3
0
 /// <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();
 }
Beispiel #5
0
 /// <nodoc />
 protected internal abstract Task <EvictResult> EvictContentAsync(
     Context context,
     ContentHashWithLastAccessTimeAndReplicaCount contentHashInfo,
     bool onlyUnlinked);
Beispiel #6
0
 /// <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)
 {
 }