예제 #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 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);
                }
            }
        }
예제 #2
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;
            }
        }
예제 #3
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);
            }
        }