Beispiel #1
0
        public StringOnlyPage(uint pageSize, ulong pageId, ulong prevPageId, ulong nextPageId, ITransaction tran)
        {
            if (pageSize < IPage.FirstElementPosition + sizeof(ushort))
            {
                throw new ArgumentException("Size can't be less than size of char + sizeof(ushort) for length.");
            }

            this.pageSize   = pageSize;
            this.pageId     = pageId;
            this.prevPageId = prevPageId;
            this.nextPageId = nextPageId;
            this.items      = new char[this.MaxRowCount()];

            ILogRecord logRecord = new AllocatePageLogRecord(pageId, tran.TranscationId(), global::PageManager.PageType.StringPage, pageSize, nextPageId, prevPageId, null);

            tran.AddRecord(logRecord);

            this.isDirty = true;
        }
Beispiel #2
0
        public MixedPage(uint pageSize, ulong pageId, ColumnInfo[] columnTypes, ulong prevPageId, ulong nextPageId, Memory <byte> memory, ulong bufferPoolToken, ITransaction tran)
        {
            if (columnTypes == null || columnTypes.Length == 0)
            {
                throw new ArgumentException("Column type definition can't be null or empty");
            }

            this.pageSize = pageSize;
            this.pageId   = pageId;

            this.columnTypes     = columnTypes;
            this.prevPageId      = prevPageId;
            this.nextPageId      = nextPageId;
            this.inMemoryStorage = memory;
            this.bufferPoolToken = bufferPoolToken;
            this.items           = new RowsetHolder(this.columnTypes, this.inMemoryStorage, init: true);

            ILogRecord logRecord = new AllocatePageLogRecord(pageId, tran.TranscationId(), global::PageManager.PageType.MixedPage, pageSize, nextPageId, prevPageId, columnTypes);

            tran.AddRecord(logRecord);

            this.isDirty = true;
        }