A base implementation of a cache of objects.
Inheritance: ICache
示例#1
0
        protected FixedSizeCollection(DataFile data, int recordSize)
        {
            if (recordSize <= 0)
                throw new ArgumentException();

            this.data = data;
            this.recordSize = recordSize;
            keyPositionCache = new MemoryCache(513, 750, 15);
        }
示例#2
0
 public LocalRowCache(DeveelDbConnection connection)
 {
     this.connection = connection;
     if (connection.Settings != null) {
         rowCache = new SizeLimitedCache (connection.Settings.RowCacheSize);
     } else {
         int defaultCacheSize = new DeveelDbConnectionStringBuilder ().RowCacheSize;
         rowCache = new SizeLimitedCache (defaultCacheSize);
     }
 }
示例#3
0
        public StoreTreeSystem(IStore nodeStore, int maxBranchChildren, int maxLeafSize, long nodeMaxCacheMemory,
		                       long branchCacheMemory)
        {
            maxBranchSize = maxBranchChildren;
            maxLeafByteSize = maxLeafSize;
            this.nodeStore = nodeStore;
            nodeHeapMaxSize = nodeMaxCacheMemory;
            versions = new List<VersionInfo>();

            // Allocate some values for the branch cache,
            long branchSizeEstimate = (maxBranchChildren*24) + 64;
            // The number of elements in the branch cache
            int branchCacheElements = (int) (branchCacheMemory/branchSizeEstimate);
            // Find a close prime to this
            int branchPrime = Cache.ClosestPrime(branchCacheElements + 20);
            // Allocate the cache
            branchCache = new MemoryCache(branchPrime, branchCacheElements, 20);

            initialized = false;
        }
示例#4
0
 public LocalRowCache(DeveelDbConnection connection)
 {
     this.connection = connection;
     rowCache = new SizeLimitedCache(connection.Settings.RowCacheSize);
 }
示例#5
0
 public LocalRowCache(DeveelDbConnection connection)
 {
     this.connection = connection;
     rowCache = new MemoryCache(connection.Settings.RowCacheSize, connection.Settings.MaxCacheSize, 20);
 }