/// <summary>
        /// Add the key and entry in the Hashtable for Invalidation by preodic thread.
        /// </summary>
        /// <param name="key">The key of the item to invalidate.</param>
        /// <param name="entry">CacheEntry to Invalidate.</param>
        internal void EnqueueOperation(object key, ReplicationOperation operation)
        {
            try
            {
                if (key == null)
                {
                    key = System.Guid.NewGuid().ToString() + Interlocked.Increment(ref _uniqueKeyNumber);
                }

                _queue.Enqueue(key, operation);

                if (ServerMonitor.MonitorActivity)
                {
                    ServerMonitor.LogClientActivity("AsyncReplicator.Enque", "queue_size :" + _queue.Count);
                }

                _context.PerfStatsColl.IncrementMirrorQueueSizeStats(_queue.Count);
            }
            catch (Exception e)
            {
                if (_context.NCacheLog.IsErrorEnabled)
                {
                    _context.NCacheLog.Error("AsyncItemReplicator", string.Format("Exception: {0}", e.ToString()));
                }
            }
        }
 /// <summary>
 /// Clears the Queue of any keys for replication.
 /// </summary>
 internal void EnqueueClear(ReplicationOperation operation)
 {
     //keysQue.Clear();
     _queue.Clear();
     this.EnqueueOperation("NcAcHe$Cl@Ea%R", operation);
 }
Beispiel #3
0
 public void Add(ReplicationOperation operation)
 {
     _operations.Add(operation);
 }
        protected ReplicationOperation GetReplicationOperation(int opCode, object info, int operationSize, Array userPayLoad, long payLoadSize)
        {
            DictionaryEntry entry = new DictionaryEntry(opCode, info);
            ReplicationOperation operation = new ReplicationOperation(entry, operationSize, userPayLoad, payLoadSize);

            return operation;
        }
        /// <summary>
        /// Add the key and entry in teh Hashtable for Invalidation by preodic thread.
        /// </summary>
        /// <param name="key">The key of the item to invalidate.</param>
        /// <param name="entry">CacheEntry to Invalidate.</param>
        internal void EnqueueOperation(object key, ReplicationOperation operation)
        {
            try
            {
                if (key == null)
                    key = System.Guid.NewGuid().ToString() + Interlocked.Increment(ref _uniqueKeyNumber);

                _queue.Enqueue(key, operation);

                if (ServerMonitor.MonitorActivity)
                    ServerMonitor.LogClientActivity("AsyncReplicator.Enque", "queue_size :" + _queue.Count);
                _context.PerfStatsColl.IncrementMirrorQueueSizeStats(_queue.Count);

            }
            catch (Exception e)
            {
                if (_context.NCacheLog.IsErrorEnabled) _context.NCacheLog.Error("AsyncItemReplicator", string.Format("Exception: {0}", e.ToString()));
            }
        }
 /// <summary>
 /// Clears the Queue of any keys for replication.
 /// </summary>
 internal void EnqueueClear(ReplicationOperation operation)
 {
     //keysQue.Clear();
     _queue.Clear();
     this.EnqueueOperation("NcAcHe$Cl@Ea%R", operation);
 }
 public void Add(ReplicationOperation operation)
 {
     _operations.Add(operation);
 }