示例#1
0
 public DataFileDefrag(Database db, DataFileCache cache, string dataFileName)
 {
     this._database     = db;
     this._cache        = cache;
     this._scale        = cache.CacheFileScale;
     this._dataFileName = dataFileName;
 }
示例#2
0
 public DataFileCache GetCache()
 {
     if (this._cache == null)
     {
         this._cache = new DataFileCache();
         this._cache.InitParams(this._database, this._fileName);
         this._cache.Open(this._filesReadOnly);
     }
     return(this._cache);
 }
示例#3
0
 public Cache(DataFileCache dfc) : base(dfc.Capacity(), 1, 3, true)
 {
     this._saveAllTimer     = new StopWatch(false);
     this._sortTimer        = new StopWatch(false);
     base.MaxCapacity       = dfc.Capacity();
     this.dataFileCache     = dfc;
     this._capacity         = dfc.Capacity();
     this._bytesCapacity    = dfc.BytesCapacity();
     this._rowComparator    = new CachedObjectComparator();
     this._rowTable         = new ICachedObject[this._capacity];
     this._cacheBytesLength = 0L;
 }
示例#4
0
        public IPersistentStore NewStore(Session session, IPersistentStoreCollection collection, TableBase table, bool diskBased)
        {
            switch (table.GetTableType())
            {
            case 1:
            case 4:
            case 11:
                return(new RowStoreAVLMemory(collection, (Table)table));

            case 2:
            case 8:
            case 10:
                break;

            case 3:
                diskBased = false;
                break;

            case 5:
            {
                DataFileCache cache = this.GetCache();
                if (cache == null)
                {
                    goto Label_0093;
                }
                RowStoreAVLDisk item = new RowStoreAVLDisk(collection, cache, (Table)table);
                this._createdStores.Add(item);
                return(item);
            }

            case 9:
                if (session != null)
                {
                    return(new RowStoreAVLHybrid(session, collection, table));
                }
                return(null);

            default:
                goto Label_0093;
            }
            if (session == null)
            {
                return(null);
            }
            return(new RowStoreAVLHybrid(session, collection, table, diskBased));

Label_0093:
            throw Error.RuntimeError(0xc9, "Logger");
        }
示例#5
0
 public RowStoreAVLDisk(IPersistentStoreCollection manager, DataFileCache cache, Table table)
 {
     this._database    = table.database;
     base.Manager      = manager;
     base.table        = table;
     base.indexList    = table.GetIndexList();
     base.AccessorList = new ICachedObject[base.indexList.Length];
     this._cache       = cache;
     if (cache != null)
     {
         this.RowOut = cache.RowOut.Duplicate();
     }
     manager.SetStore(table, this);
     this._database = table.database;
 }
示例#6
0
 public override void SetCache(DataFileCache cache)
 {
     throw Error.RuntimeError(0xc9, "RowStoreAVLHybrid");
 }
示例#7
0
 public override void SetCache(DataFileCache cache)
 {
     this._cache = cache;
 }
示例#8
0
 public override void Release()
 {
     ArrayUtil.FillArray(base.AccessorList, null);
     this._cache = null;
 }
示例#9
0
 public abstract void SetCache(DataFileCache cache);
示例#10
0
 public override void SetCache(DataFileCache cache)
 {
 }