/// <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); } } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or /// resetting unmanaged resources. /// </summary> public void Dispose() { if (_printThread != null) { NCacheLog.Flush(); _printThread.Abort(); } _printThread = null; if (_logger != null) { _logger.Close(); } lock (this) { if (_pcBcastQueueCount != null) { _pcBcastQueueCount.RemoveInstance(); _pcBcastQueueCount.Dispose(); _pcBcastQueueCount = null; } if (_pcMcastQueueCount != null) { _pcMcastQueueCount.RemoveInstance(); _pcMcastQueueCount.Dispose(); _pcMcastQueueCount = null; } if (_pcTcpDownQueueCount != null) { _pcTcpDownQueueCount.RemoveInstance(); _pcTcpDownQueueCount.Dispose(); _pcTcpDownQueueCount = null; } if (_pcTcpUpQueueCount != null) { _pcTcpUpQueueCount.RemoveInstance(); _pcTcpUpQueueCount.Dispose(); _pcTcpUpQueueCount = null; } if (_pcClusteredOperationsPerSec != null) { _pcClusteredOperationsPerSec.RemoveInstance(); _pcClusteredOperationsPerSec.Dispose(); _pcClusteredOperationsPerSec = null; } if (_pcBytesSentPerSec != null) { _pcBytesSentPerSec.RemoveInstance(); _pcBytesSentPerSec.Dispose(); _pcBytesSentPerSec = null; } if (_pcBytesReceivedPerSec != null) { _pcBytesReceivedPerSec.RemoveInstance(); _pcBytesReceivedPerSec.Dispose(); _pcBytesReceivedPerSec = null; } if (_pcNagglingMsgCount != null) { _pcNagglingMsgCount.RemoveInstance(); _pcNagglingMsgCount.Dispose(); _pcNagglingMsgCount = null; } if (_pcSocketSendSize != null) { _pcSocketSendSize.RemoveInstance(); _pcSocketSendSize.Dispose(); _pcSocketSendSize = null; } if (_pcSocketSendTime != null) { _pcSocketSendTime.RemoveInstance(); _pcSocketSendTime.Dispose(); _pcSocketSendTime = null; } if (_pcSocketReceiveSize != null) { _pcSocketReceiveSize.RemoveInstance(); _pcSocketReceiveSize.Dispose(); _pcSocketReceiveSize = null; } if (_pcSocketReceiveTime != null) { _pcSocketReceiveTime.RemoveInstance(); _pcSocketReceiveTime.Dispose(); _pcSocketReceiveTime = null; } } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or /// resetting unmanaged resources. /// </summary> public void Dispose() { if (_printThread != null) { NCacheLog.Flush(); #if !NETCORE _printThread.Abort(); #elif NETCORE _printThread.Interrupt(); #endif } _printThread = null; if (_logger != null) { _logger.Close(); } lock (this) { if (_pcBcastQueueCount != null) { _pcBcastQueueCount.RemoveInstance(); _pcBcastQueueCount.Dispose(); _pcBcastQueueCount = null; } if (_pcMcastQueueCount != null) { _pcMcastQueueCount.RemoveInstance(); _pcMcastQueueCount.Dispose(); _pcMcastQueueCount = null; } if (_pcTcpDownQueueCount != null) { _pcTcpDownQueueCount.RemoveInstance(); _pcTcpDownQueueCount.Dispose(); _pcTcpDownQueueCount = null; } if (_pcTcpUpQueueCount != null) { _pcTcpUpQueueCount.RemoveInstance(); _pcTcpUpQueueCount.Dispose(); _pcTcpUpQueueCount = null; } if (_pcClusteredOperationsPerSec != null) { _pcClusteredOperationsPerSec.RemoveInstance(); _pcClusteredOperationsPerSec.Dispose(); _pcClusteredOperationsPerSec = null; } if (_pcBytesSentPerSec != null) { _pcBytesSentPerSec.RemoveInstance(); _pcBytesSentPerSec.Dispose(); _pcBytesSentPerSec = null; } if (_pcBytesReceivedPerSec != null) { _pcBytesReceivedPerSec.RemoveInstance(); _pcBytesReceivedPerSec.Dispose(); _pcBytesReceivedPerSec = null; } if (_pcSocketSendSize != null) { _pcSocketSendSize.RemoveInstance(); _pcSocketSendSize.Dispose(); _pcSocketSendSize = null; } if (_pcSocketSendTime != null) { _pcSocketSendTime.RemoveInstance(); _pcSocketSendTime.Dispose(); _pcSocketSendTime = null; } if (_pcSocketReceiveSize != null) { _pcSocketReceiveSize.RemoveInstance(); _pcSocketReceiveSize.Dispose(); _pcSocketReceiveSize = null; } if (_pcSocketReceiveTime != null) { _pcSocketReceiveTime.RemoveInstance(); _pcSocketReceiveTime.Dispose(); _pcSocketReceiveTime = null; } /// if (_pcTcpDownEnter != null) { _pcTcpDownEnter.RemoveInstance(); _pcTcpDownEnter.Dispose(); _pcTcpDownEnter = null; } if (_pcClusterOpsSent != null) { _pcClusterOpsSent.RemoveInstance(); _pcClusterOpsSent.Dispose(); _pcClusterOpsSent = null; } if (_pcClusterOpsReceived != null) { _pcClusterOpsReceived.RemoveInstance(); _pcClusterOpsReceived.Dispose(); _pcClusterOpsReceived = null; } if (_pcResponseSent != null) { _pcResponseSent.RemoveInstance(); _pcResponseSent.Dispose(); _pcResponseSent = null; } //// } }