コード例 #1
0
ファイル: HashedLocalCache.cs プロジェクト: yaobos/NCache
        /// <summary>
        /// Removes all entries from the store.
        /// </summary>
        internal override void ClearInternal()
        {
            base.ClearInternal();
            if (_keyList != null)
            {
                _keyList.Clear();
            }
            if (_logMgr != null)
            {
                _logMgr.Dispose();                  //it clears the operation loggers for each bucket
            }
            if (LocalBuckets == null)
            {
                return;
            }
            //clear the bucket stats
            IDictionaryEnumerator ide = LocalBuckets.GetEnumerator();

            while (ide.MoveNext())
            {
                BucketStatistics stats = ide.Value as BucketStatistics;
                if (stats != null)
                {
                    stats.Clear();
                }
            }
        }
コード例 #2
0
 public override void Dispose()
 {
     if (_logMgr != null)
     {
         _logMgr.Dispose();
     }
     if (_keyList != null)
     {
         _keyList.Clear();
     }
     base.Dispose();
 }