public void EvictData(long size) { //TODO: evict items so that size amount of space is freed if (!_evictionPolicy.Execute(this, size)) { //TODO: if eviction does not free space. int a = 1; } //throw new NotImplementedException(); }
/// <summary> /// Faz a liberação. /// </summary> /// <param name="cache"></param> private void DoEvict(CacheBase cache) { if (_evictionPolicy != null) { _evictionPolicy.Execute(cache, base._context, this.Size); if (_allowExplicitGCCollection) { GC.Collect(); } } }
public void Execute(CacheBase cache, CacheRuntimeContext context, long count) { Sync.AcquireWriterLock(Timeout.Infinite); try { _evctPolicy.Execute(cache, context, count); } finally { Sync.ReleaseWriterLock(); } }
/// <summary> /// Evicts the items from the cache. /// </summary> private void DoEvict(CacheBase cache) { try { if (_evictionPolicy != null) { _evictionPolicy.Execute(cache, _context, Size); } } finally { } }
/// <summary> /// Evicts the items from the cache. /// </summary> private void DoEvict(CacheBase cache) { try { if (_evictionPolicy != null) { var sizeToEvict = (long)Math.Ceiling(Size * _evictionPolicy.EvictRatio); long evictedSize = _evictionPolicy.Execute(cache, _context, Size); if (sizeToEvict > evictedSize) { _context.MessageManager.Evict(sizeToEvict - evictedSize); } } } finally { } }