예제 #1
0
        /// <summary>
        /// Get a snaphot from the pool
        /// </summary>
        /// <param name="pointerID"></param>
        /// <param name="cache"></param>
        /// <returns></returns>
        public Array GetSnaphot(string pointerID, CacheBase cache)
        {
            CachePool pool = null;

            if (_cachePoolMap.Contains(cache.Context.CacheRoot.Name))
            {
                pool = _cachePoolMap[cache.Context.CacheRoot.Name] as CachePool;
                return(pool.GetSnaphotInPool(pointerID, cache));
            }
            else
            {
                pool = new CachePool(_minSnaphotSizeForPooling, _maxSnapshotsInPool, _newSnapshotCreationThreshold);
                _cachePoolMap.Add(cache.Context.CacheRoot.Name, pool);
            }
            return(pool.GetSnaphotInPool(pointerID, cache));
        }
예제 #2
0
        /// <summary>
        /// Get a snaphot from the pool
        /// </summary>
        /// <param name="pointerID"></param>
        /// <param name="cache"></param>
        /// <returns></returns>
        public Array GetSnaphot(string pointerID, CacheBase cache)
        {
            CachePool pool = null;

            if (_cachePoolMap.Contains(cache.Context.CacheRoot.Name))
            {
                pool = _cachePoolMap[cache.Context.CacheRoot.Name] as CachePool;
                return(pool.GetSnaphotInPool(pointerID, cache));
            }
            else
            {
                pool = new CachePool();
                _cachePoolMap.Add(cache.Context.CacheRoot.Name, pool);
            }
            return(pool.GetSnaphotInPool(pointerID, cache));
        }