Example #1
0
 public RowStoreAVLHybrid(Session session, IPersistentStoreCollection manager, TableBase table, bool useCache)
 {
     this._session           = session;
     base.Manager            = manager;
     base.table              = table;
     this._maxMemoryRowCount = session.GetResultMemoryRowCount();
     this._isTempTable       = table.GetTableType() == 3;
     this._useCache          = useCache;
     if (this._maxMemoryRowCount == 0)
     {
         this._useCache = false;
     }
     if (table.GetTableType() == 9)
     {
         base.Timestamp = session.GetActionTimestamp();
     }
     this.ResetAccessorKeys(table.GetIndexList());
     manager.SetStore(table, this);
 }
Example #2
0
        public static Index NewIndex(QNameManager.QName name, long id, TableBase table, int[] columns, bool[] descending, bool[] nullsLast, SqlType[] colTypes, bool pk, bool unique, bool constraint, bool forward)
        {
            if ((table.database.DatabaseProperties != null) && (table.database.DatabaseProperties.GetIntegerProperty("LibCore.result_max_memory_rows") == 0))
            {
                switch (table.GetTableType())
                {
                case 1:
                case 2:
                case 3:
                case 4:
                case 8:
                case 9:
                case 10:
                case 11:
                    return(new IndexAVLMemory(name, id, table, columns, descending, nullsLast, colTypes, pk, unique, constraint, forward));

                case 5:
                    return(new IndexAVL(name, id, table, columns, descending, nullsLast, colTypes, pk, unique, constraint, forward));
                }
            }
            else
            {
                switch (table.GetTableType())
                {
                case 1:
                case 4:
                    return(new IndexAVLMemory(name, id, table, columns, descending, nullsLast, colTypes, pk, unique, constraint, forward));

                case 2:
                case 3:
                case 5:
                case 8:
                case 9:
                case 10:
                case 11:
                    return(new IndexAVL(name, id, table, columns, descending, nullsLast, colTypes, pk, unique, constraint, forward));
                }
            }
            throw Error.RuntimeError(0xc9, "Logger");
        }
Example #3
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");
        }