Exemplo n.º 1
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">cache events listener</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public LocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)

            : base(properties, parentCache, listener, context)
        {
            _stats.ClassName = "local-cache";
            Initialize(cacheClasses, properties);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Cria a instancia já definindo as propriedades os listener de ventos o contexto.
 /// </summary>
 /// <param name="properties">Propriedades</param>
 /// <param name="listener"></param>
 /// <param name="context">Contexto.</param>
 public CacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
 {
     _name     = string.Empty;
     _context  = context;
     _listener = listener;
     _syncObj  = new ReaderWriterLock();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Overloaded constructor. Takes the listener as parameter.
 /// </summary>
 /// <param name="listener">listener of Cache events.</param>
 public CacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
 {
     _context        = context;
     _listener       = listener;
     _syncObj        = new ReaderWriterLock();
     _KeyLockManager = new KeyLockManager <object>(LockRecursionPolicy.SupportsRecursion);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyAdd(ICacheEventsListener listener, object key, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _key              = key;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 5
0
        public void StartMessageProcessing()
        {
            _store = _context.CacheImpl;
            _cacheEventListener = _context.CacheImpl as ICacheEventsListener;

            _store.RegiserTopicEventListener(this);

            if (_assignmentThread == null)
            {
                _assignmentThread = new Thread(new ThreadStart(ProcessMessage));
                _assignmentThread.IsBackground = true;
                _assignmentThread.Name         = "Messaging.MessageProcessor";
                _assignmentThread.Start();
            }

            if (_notificationThread == null)
            {
                _notificationThread = new Thread(new ThreadStart(NotifyClients));
                _notificationThread.IsBackground = true;
                _notificationThread.Name         = "Messaging.Notification";
                _notificationThread.Start();
            }

            if (_taskExpiry == null)
            {
                _taskExpiry = new AutoExpirationTask(this, _cleanInterval);
                _context.TimeSched.AddTask(_taskExpiry);
            }
        }
 public AsyncLocalNotifyRemoveCallback(ICacheEventsListener listener, object key, object entry, ItemRemoveReason reason)
 {
     _listener = listener;
     _key      = key;
     _entry    = entry;
     _reason   = reason;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">cache events listener</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public IndexedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
            : base(cacheClasses, parentCache, properties, listener, context)
        {
            IDictionary props = null;
            if (properties.Contains("indexes"))
            {
                props = properties["indexes"] as IDictionary;
            }

            _queryIndexManager = new QueryIndexManager(props, this, _context.CacheRoot.Name);
            if (!_queryIndexManager.Initialize()) _queryIndexManager = null;


            //+Numan16122014
            _cacheStore.ISizableQueryIndexManager = _queryIndexManager;            
            _cacheStore.ISizableEvictionIndexManager = _evictionPolicy;
            _cacheStore.ISizableExpirationIndexManager = _context.ExpiryMgr;

            _stats.MaxCount = _cacheStore.MaxCount;
            _stats.MaxSize = _cacheStore.MaxSize;

            //+Numan16122014

            if (_context.PerfStatsColl != null)
            {
                if (_queryIndexManager != null)
                    _context.PerfStatsColl.SetQueryIndexSize(_queryIndexManager.IndexInMemorySize);                
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalPollRequestCallback(ICacheEventsListener listener, string clientId, short callbackId, EventType eventType)
 {
     _listener   = listener;
     _clientId   = clientId;
     _callbackId = callbackId;
     _eventType  = eventType;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyUpdateCallback(ICacheEventsListener listener, object key, object entry, OperationContext operationContext, EventContext eventContext)
 {
     _listener = listener;
     _key = key;
     _entry = entry;
     _operationContext = operationContext;
     _eventContext = eventContext;
 }
Exemplo n.º 10
0
 public AsyncLocalNotifyRemoval(ICacheEventsListener listener, object key, object value, ItemRemoveReason reason, OperationContext operationContext)
 {
     _listener         = listener;
     _key              = key;
     _value            = value;
     _reason           = reason;
     _operationContext = operationContext;
 }
Exemplo n.º 11
0
 /**
  * Constructor
  *
  * @param listener
  * @param data
  */
 public AsyncLocalNotifyTaskCallback(ICacheEventsListener listener, string taskID, Object entry, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _taskID           = taskID;
     _entry            = entry;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyCustomEvent(ICacheEventsListener listener, object notifId, object data, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _notifId          = notifId;
     _data             = data;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyUpdateCallback(ICacheEventsListener listener, object key, object entry, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _key              = key;
     _entry            = entry;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyRemoveCallback(ICacheEventsListener listener, object key, object entry, ItemRemoveReason reason, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _key              = key;
     _entry            = entry;
     _reason           = reason;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncCQUpdateCallback(ICacheEventsListener listener, object key, QueryChangeType changeType, List <CQCallbackInfo> queries, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _key              = key;
     _changeType       = changeType;
     _queries          = queries;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Construtor padrão.
 /// </summary>
 /// <param name="queryChangeListener">Instancia que irá escutar os eventos do cache.</param>
 /// <param name="indexedTypes">Hahs com os tipos indexados.</param>
 /// <param name="cacheContext">Nome do contexto.</param>
 internal ActiveQueryAnalyzer(ICacheEventsListener queryChangeListener, IDictionary indexedTypes, string cacheContext)
 {
     _queryChangesListener             = queryChangeListener;
     _typeSpecificPredicates           = new Dictionary <string, Dictionary <string, List <PredicateHolder> > >();
     _typeSpecificRegisteredPredicates = new Dictionary <string, List <PredicateHolder> >();
     _typeSpecificEvalIndexes          = new Dictionary <string, ActiveQueryEvaluationIndex>();
     if (indexedTypes.Contains("indexes"))
     {
         this.InitializeEvalIndexes(indexedTypes["indexes"] as IDictionary, cacheContext);
     }
 }
Exemplo n.º 17
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or
 /// resetting unmanaged resources.
 /// </summary>
 public virtual void Dispose()
 {
     if (writer != null)
     {
         lock (writer)
         {
             writer.Close();
             writer = null;
         }
     }
     _listener = null;
     _syncObj  = null;
     GC.SuppressFinalize(this);
 }
Exemplo n.º 18
0
        public PullBaseNotificationManager(ICacheEventsListener listner, ILogger logger)
        {
            _pollRequestInterval = ServiceConfiguration.NotificationEventInterval * 1000; //convert in miliseconds
            _deadClientInterval  = 30 * 60 * 1000;                                        //30Minutes
            _clients             = new HashVector <string, ClientNotificationMgr>();
            _updatedKeys         = new HashVector <string, KeyInfo>();
            _removedKeys         = new HashVector <string, KeyInfo>();
            _registeredKeys      = new HashVector <string, KeyInfo>();
            _listner             = listner;

            _pollRequestThread              = new Thread(SendPollRequestTask);
            _pollRequestThread.Name         = "PullRequestThread";
            _pollRequestThread.IsBackground = true;
            _pollRequestThread.Start();

            _logger = logger;
        }
 public AsyncLocalNotifyHashmapCallback(ICacheEventsListener listener, long lastViewid, Hashtable newmap, ArrayList members, bool updateClientMap)
 {
     this._listener        = listener;
     this._hashMap         = new NewHashmap(lastViewid, newmap, members);
     this._updateClientMap = updateClientMap;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Overloaded constructor. Takes the properties as a map.
 /// </summary>
 /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
 /// <param name="properties">properties collection for this cache.</param>
 /// <param name="listener">cache events listener</param>
 /// <param name="timeSched">scheduler to use for periodic tasks</param>
 public LocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
     : base(properties, parentCache, listener, context)
 {
     _stats.ClassName = "local-cache";
     _topicManager    = new TopicManager(context);
     Initialize(cacheClasses, properties);
     CreateEventsTopics();
     _cacheStore.ISizableEvictionIndexManager   = _evictionPolicy;
     _cacheStore.ISizableExpirationIndexManager = _context.ExpiryMgr;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or 
 /// resetting unmanaged resources.
 /// </summary>
 public virtual void Dispose()
 {
     if (writer != null)
     {
         lock (writer)
         {
             writer.Close();
             writer = null;
         }
     }
     _listener = null;
     _syncObj = null;
     GC.SuppressFinalize(this);
 }
Exemplo n.º 22
0
        /// <summary>
        /// Overloaded constructor. Takes the listener as parameter.
        /// </summary>
        /// <param name="properties"></param>
        /// <param name="listener"></param>
        /// <param name="timeSched"></param>
        /// <param name="asyncProcessor"></param>
        /// <param name="expiryMgr"></param>
        /// <param name="perfStatsColl"></param>
        public LocalCacheBase(IDictionary properties, CacheBase parentCache, ICacheEventsListener listener, CacheRuntimeContext context

)
            : base(properties, listener, context)
        {

            if (System.Configuration.ConfigurationSettings.AppSettings.Get("preparedQueryTableSize") != null)
            {
                _preparedQueryTableSize = Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("preparedQueryTableSize"));
            }
            if (System.Configuration.ConfigurationSettings.AppSettings.Get("preparedQueryEvictionPercentage") != null)
            {
                _preparedQueryEvictionPercentage = Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("preparedQueryEvictionPercentage"));
            }

            _stats = new CacheStatistics();

            _stats.InstanceName = _context.PerfStatsColl.InstanceName;

            _parentCache = parentCache;

        }
Exemplo n.º 23
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyCacheClear(ICacheEventsListener listener, OperationContext operationContext, EventContext eventContext)
 {
     _listener         = listener;
     _operationContext = operationContext;
     _eventContext     = eventContext;
 }
Exemplo n.º 24
0
        /// <summary>
        /// Overloaded constructor. Takes the listener as parameter.
        /// </summary>
        /// <param name="listener">listener of Cache events.</param>
        public ClusterCacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, IClusterEventsListener clusterListener)
            : base(properties, listener, context)
        {
            this._nodeInformationTable = Hashtable.Synchronized(new Hashtable(10));

            _stats = new ClusterCacheStatistics();
            _stats.InstanceName = _context.PerfStatsColl.InstanceName;

            _clusterListener = clusterListener;

            _nodeName = Environment.MachineName.ToLower();

        }
Exemplo n.º 25
0
 /// <summary>
 /// Overloaded constructor. Takes the properties as a map.
 /// </summary>
 /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
 /// <param name="properties">properties collection for this cache.</param>
 /// <param name="listener">cache events listener</param>
 /// <param name="timeSched">scheduler to use for periodic tasks</param>
 public IndexedOverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
     : base( cacheClasses, parentCache, properties, listener, context)
 {
 }
Exemplo n.º 26
0
 public HashedOverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, bool logEntries, ActiveQueryAnalyzer activeQueryAnalyzer)
     : base(cacheClasses, parentCache, properties, listener, context, activeQueryAnalyzer)
 {
     _logMgr     = new OpLogManager(logEntries, context);
     _logEntries = logEntries;
 }
Exemplo n.º 27
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">cache events listener</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public IndexedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
            : base(cacheClasses, parentCache, properties, listener, context)
        {
            IDictionary props = null;

            if (properties.Contains("indexes"))
            {
                props = properties["indexes"] as IDictionary;
            }

            _queryIndexManager = new QueryIndexManager(props, this, _context.CacheRoot.Name);
            if (!_queryIndexManager.Initialize())
            {
                _queryIndexManager = null;
            }


            //+Numan16122014
            _cacheStore.ISizableQueryIndexManager      = _queryIndexManager;
            _cacheStore.ISizableEvictionIndexManager   = _evictionPolicy;
            _cacheStore.ISizableExpirationIndexManager = _context.ExpiryMgr;

            _stats.MaxCount = _cacheStore.MaxCount;
            _stats.MaxSize  = _cacheStore.MaxSize;

            //+Numan16122014

            if (_context.PerfStatsColl != null)
            {
                if (_queryIndexManager != null)
                {
                    _context.PerfStatsColl.SetQueryIndexSize(_queryIndexManager.IndexInMemorySize);
                }
            }
        }
Exemplo n.º 28
0
 public HashedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, bool logEntries)
     : base(cacheClasses, parentCache, properties, listener, context)
 {
     _logMgr = new OpLogManager(logEntries, context);
     _stats.LocalBuckets = new HashVector();
 }
Exemplo n.º 29
0
 public OverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, ActiveQueryAnalyzer activeQueryAnalyzer) : base(properties, parentCache, listener, context, activeQueryAnalyzer)
 {
     this.Initialize(cacheClasses, properties);
 }
Exemplo n.º 30
0
        /// <summary>
        /// Overloaded constructor. Takes the listener as parameter.
        /// </summary>
        /// <param name="listener">listener of Cache events.</param>
        public CacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
        {
            _context = context;
            _listener = listener;
            _syncObj = new ReaderWriterLock();

        }
Exemplo n.º 31
0
            public AsyncLocalNotifyHashmapCallback(ICacheEventsListener listener, long lastViewid, Hashtable newmap, ArrayList members, bool updateClientMap)
            {
                this._listener = listener;
                this._hashMap = new NewHashmap(lastViewid, newmap, members);
                this._updateClientMap = updateClientMap;

            }
Exemplo n.º 32
0
 public AsyncLocalNotifyAdd(ICacheEventsListener listener, object key)
 {
     _listener = listener;
     _key      = key;
 }
Exemplo n.º 33
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyRemoveCallback(ICacheEventsListener listener, object key, object entry, ItemRemoveReason reason, OperationContext operationContext, EventContext eventContext)
 {
     _listener = listener;
     _key = key;
     _entry = entry;
     _reason = reason;
     _operationContext = operationContext;
     _eventContext = eventContext;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Overloaded constructor. Takes the listener as parameter.
 /// </summary>
 /// <param name="listener">listener of Cache events.</param>
 public ReplicatedCacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, IClusterEventsListener clusterListener)
     : base(properties, listener, context, clusterListener)
 {
 }
Exemplo n.º 35
0
 public HashedOverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, bool logEntries)
     : base(cacheClasses, parentCache, properties, listener, context)
 {
     _logMgr = new OpLogManager(logEntries, context);
     _logEntries = logEntries;
 }
Exemplo n.º 36
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">listener for the cache</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public OverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
            : base(properties, parentCache, listener, context)
        {
            _stats.ClassName = "overflow-cache";
            Initialize(cacheClasses, properties);

            CacheStatistics pstat = _primary.Statistics, sstat = _secondary.Statistics;

            if (pstat.MaxCount == 0 || sstat.MaxCount == 0)
            {
                _stats.MaxCount = 0;
            }
            else
            {
                _stats.MaxCount = pstat.MaxCount + sstat.MaxCount;
            }
        }
Exemplo n.º 37
0
 /// <summary>
 /// Overloaded constructor. Takes the listener as parameter.
 /// </summary>
 /// <param name="listener">listener of Cache events.</param>
 public PartitionedCacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
     : base(properties, listener, context)
 {
 }
Exemplo n.º 38
0
		/// <summary>
		/// Overloaded constructor. Takes the properties as a map.
		/// </summary>
		/// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
		/// <param name="properties">properties collection for this cache.</param>
		/// <param name="listener">listener for the cache</param>
		/// <param name="timeSched">scheduler to use for periodic tasks</param>
        public OverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
            : base(properties, parentCache, listener, context)
		{
			_stats.ClassName = "overflow-cache";
			Initialize(cacheClasses, properties);

			CacheStatistics pstat = _primary.Statistics, sstat = _secondary.Statistics;
			if(pstat.MaxCount == 0 || sstat.MaxCount == 0)
				_stats.MaxCount = 0;
			else
				_stats.MaxCount = pstat.MaxCount + sstat.MaxCount;
		}
Exemplo n.º 39
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
 /// <param name="properties">properties collection for this cache.</param>
 /// <param name="listener">cache events listener</param>
 public ReplicatedServerCache(IDictionary cacheClasses, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
     : base(properties, listener, context)
 {
     _stats.ClassName = "replicated-server";
     Initialize(cacheClasses, properties);
 }
Exemplo n.º 40
0
 /// <summary>
 /// Overloaded constructor. Takes the listener as parameter.
 /// </summary>
 /// <param name="listener">listener of Cache events.</param>
 public MirrorCacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, IClusterEventsListener clusterListener)
     : base(properties, listener, context, clusterListener)
 {
 }
Exemplo n.º 41
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="cacheClasses"></param>
 /// <param name="properties"></param>
 /// <param name="listener"></param>
 /// <param name="context"></param>
 /// <param name="clusterListener"></param>
 /// <param name="userId"></param>
 /// <param name="password"></param>
 public ReplicatedServerCache(IDictionary cacheClasses, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, IClusterEventsListener clusterListener)
     : base(properties, listener, context, clusterListener)
 {
     _stats.ClassName = "replicated-server";
 }
Exemplo n.º 42
0
 public HashedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, bool logEntries)
     : base(cacheClasses, parentCache, properties, listener, context)
 {
     _logMgr             = new OpLogManager(logEntries, context);
     _stats.LocalBuckets = new Hashtable();
 }
Exemplo n.º 43
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">cache events listener</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public LocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)

            : base(properties, parentCache, listener, context)
        {
            _stats.ClassName = "local-cache";
            Initialize(cacheClasses, properties);
        }
Exemplo n.º 44
0
        /// <summary>
        /// Construtor padrão.
        /// </summary>
        /// <param name="cacheClasses"></param>
        /// <param name="parentCache">Cache pai.</param>
        /// <param name="properties">Propriedades de configuração da instancia.</param>
        /// <param name="listener"></param>
        /// <param name="context"></param>
        /// <param name="activeQueryAnalyzer"></param>
        public IndexedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, ActiveQueryAnalyzer activeQueryAnalyzer) : base(cacheClasses, parentCache, properties, listener, context, activeQueryAnalyzer)
        {
            _grpIndexManager = new GroupIndexManager();
            IDictionary props = null;

            if (properties.Contains("indexes"))
            {
                props = properties["indexes"] as IDictionary;
            }
            _queryIndexManager = new NamedTagIndexManager(props, this, base._context.CacheRoot.Name);
            if (!_queryIndexManager.Initialize())
            {
                _queryIndexManager = null;
            }
        }
Exemplo n.º 45
0
 /// <summary>
 /// Overloaded constructor. Takes the listener as parameter.
 /// </summary>
 /// <param name="listener">listener of Cache events.</param>
 public PartitionedCacheBase(IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context)
     : base(properties, listener, context)
 {
 }
Exemplo n.º 46
0
 /// <summary>
 /// Overloaded constructor. Takes the properties as a map.
 /// </summary>
 /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
 /// <param name="properties">properties collection for this cache.</param>
 /// <param name="listener">cache events listener</param>
 /// <param name="timeSched">scheduler to use for periodic tasks</param>
 public IndexedOverflowCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context, ActiveQueryAnalyzer activeQueryAnalyzer)
     : base(cacheClasses, parentCache, properties, listener, context, activeQueryAnalyzer)
 {
 }
Exemplo n.º 47
0
        /// <summary>
        /// Overloaded constructor. Takes the properties as a map.
        /// </summary>
        /// <param name="cacheSchemes">collection of cache schemes (config properties).</param>
        /// <param name="properties">properties collection for this cache.</param>
        /// <param name="listener">cache events listener</param>
        /// <param name="timeSched">scheduler to use for periodic tasks</param>
        public IndexedLocalCache(IDictionary cacheClasses, CacheBase parentCache, IDictionary properties, ICacheEventsListener listener, CacheRuntimeContext context

                                 , ActiveQueryAnalyzer activeQueryAnalyzer

                                 )
            : base(cacheClasses, parentCache, properties, listener, context

                   , activeQueryAnalyzer

                   )
        {
            _grpIndexManager = new GroupIndexManager();


            IDictionary props = null;

            if (properties.Contains("indexes"))
            {
                props = properties["indexes"] as IDictionary;
            }

            _queryIndexManager = new NamedTagIndexManager(props, this, _context.CacheRoot.Name);

            if (!_queryIndexManager.Initialize(null))
            {
                _queryIndexManager = null;
            }

            _cacheStore.ISizableQueryIndexManager      = _queryIndexManager;
            _cacheStore.ISizableGroupIndexManager      = _grpIndexManager;
            _cacheStore.ISizableEvictionIndexManager   = _evictionPolicy;
            _cacheStore.ISizableExpirationIndexManager = _context.ExpiryMgr;

            _stats.MaxCount = _cacheStore.MaxCount;
            _stats.MaxSize  = _cacheStore.MaxSize;

            if (_context.PerfStatsColl != null)
            {
                if (_queryIndexManager != null)
                {
                    _context.PerfStatsColl.SetQueryIndexSize(_queryIndexManager.IndexInMemorySize);
                }

                _context.PerfStatsColl.SetGroupIndexSize(_grpIndexManager.IndexInMemorySize);
            }
        }