예제 #1
0
        /// <summary>
        /// Constructs a brand new binary Page object with a size based on the DatabaseConstants file. Use this constructor when creating
        /// a brand new page (i.e. not loading from disk)
        /// </summary>
        /// <param name="id">The id of this page</param>
        /// <param name="tableId">The table id that this page belongs to</param>
        /// <param name="dbId">The database id that this page belongs to</param>
        public Page(int id, int tableId, int dbId, TableSchema2 schema, Process process)
        {
            _id      = id;
            _tableId = tableId;
            _dbId    = dbId;
            _address = new PageAddress {
                DatabaseId = DbId, TableId = TableId, PageId = Id
            };
            _data      = new byte[DatabaseConstants.PAGE_SIZE];
            _totalRows = 0;
            _schema    = schema;
            _process   = process;

            SetPreamble(true);
            InitalizeDataWithEndOfRowData();

            _pendingXacts = new List <Guid>();
        }
예제 #2
0
 /// <summary>
 /// Constructs a Row2 object along with setting it's page address.
 /// </summary>
 /// <param name="pageAddress">The page address of the row</param>
 /// <param name="preamble">The binary preamble of the row</param>
 /// <param name="columns">The column schema of the row</param>
 public Row2(PageAddress pageAddress, byte[] preamble, List <ColumnSchema> columns) : this(preamble, columns)
 {
     _pageAddress = pageAddress;
 }