Exemple #1
0
        /// <summary>
        /// Removes all entries from the store.
        /// </summary>
        internal override void ClearInternal()
        {
            if (_cacheStore == null)
            {
                throw new InvalidOperationException();
            }

            _cacheStore.Clear();

            _topicManager.Clear();

            _context.PerfStatsColl.SetCacheSize(0); // on clear cache cachesize set to zero

            if (_evictionThread != null)
            {
                NCacheLog.Flush();
#if !NETCORE
                _evictionThread.Abort();
#elif NETCORE
                _evictionThread.Interrupt();
#endif
            }

            if (_evictionPolicy != null)
            {
                _evictionPolicy.Clear();

                if (_context.PerfStatsColl != null)
                {
                    _context.PerfStatsColl.SetEvictionIndexSize(_evictionPolicy.IndexInMemorySize);
                }
            }
        }
Exemple #2
0
 public void Clear()
 {
     Sync.AcquireWriterLock(Timeout.Infinite);
     try
     {
         _evctPolicy.Clear();
     }
     finally
     {
         Sync.ReleaseWriterLock();
     }
 }
Exemple #3
0
 /// <summary>
 /// Método interno usado para limpar os dados da instancia.
 /// </summary>
 internal override void ClearInternal()
 {
     if (_cacheStore == null)
     {
         throw new InvalidOperationException();
     }
     _cacheStore.Clear();
     if (_evictionThread != null)
     {
         _evictionThread.Abort();
     }
     if (_evictionPolicy != null)
     {
         _evictionPolicy.Clear();
     }
 }