/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * Redo a change in a table. * * @param tableId the object id of the table * @param row the row * @param add true if the record is added, false if deleted */ void redo(int tableId, Row row, boolean add) { if (tableId == META_TABLE_ID) { if (add) { addMeta(row, pageStoreSession, true); } else { removeMeta(row); } } Index index = metaObjects.get(tableId); if (index == null) { throw DbException.throwInternalError( "Table not found: " + tableId + " " + row + " " + add); } Table table = index.getTable(); if (add) { table.addRow(pageStoreSession, row); } else { table.removeRow(pageStoreSession, row); } }
private void readMetaData() { Cursor cursor = metaIndex.find(pageStoreSession, null, null); // first, create all tables while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type == META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } // now create all secondary indexes // otherwise the table might not be created yet cursor = metaIndex.find(pageStoreSession, null, null); while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type != META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } }
public PageDelegateIndex(RegularTable table, int id, String name, IndexType indexType, PageDataIndex mainIndex, boolean create, Session session) { IndexColumn[] cols = IndexColumn.wrap( new Column[] { table.getColumn(mainIndex.getMainIndexColumn())}); this.initBaseIndex(table, id, name, cols, indexType); this.mainIndex = mainIndex; if (!database.isPersistent() || id < 0) { throw DbException.throwInternalError("" + name); } PageStore store = database.getPageStore(); store.addIndex(this); if (create) { store.addMeta(this, session); } }
store.addMeta(this, session); PageDataLeaf root = PageDataLeaf.create(this, rootPageId, PageData.ROOT); store.update(root);
store.addMeta(this, session); PageBtreeLeaf root = PageBtreeLeaf.create(this, rootPageId, PageBtree.ROOT); store.logUndo(root, null);
/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * The root page has changed. * * @param session the session * @param newPos the new position */ void setRootPageId(Session session, int newPos) { store.removeMeta(this, session); this.rootPageId = newPos; store.addMeta(this, session); store.addIndex(this); }
/** * Redo a change in a table. * * @param tableId the object id of the table * @param row the row * @param add true if the record is added, false if deleted */ void redo(int tableId, Row row, boolean add) { if (tableId == META_TABLE_ID) { if (add) { addMeta(row, pageStoreSession, true); } else { removeMeta(row); } } Index index = metaObjects.get(tableId); if (index == null) { throw DbException.throwInternalError( "Table not found: " + tableId + " " + row + " " + add); } Table table = index.getTable(); if (add) { table.addRow(pageStoreSession, row); } else { table.removeRow(pageStoreSession, row); } }
/** * Redo a change in a table. * * @param tableId the object id of the table * @param row the row * @param add true if the record is added, false if deleted */ void redo(int tableId, Row row, boolean add) { if (tableId == META_TABLE_ID) { if (add) { addMeta(row, pageStoreSession, true); } else { removeMeta(row); } } Index index = metaObjects.get(tableId); if (index == null) { throw DbException.throwInternalError( "Table not found: " + tableId + " " + row + " " + add); } Table table = index.getTable(); if (add) { table.addRow(pageStoreSession, row); } else { table.removeRow(pageStoreSession, row); } }
private void readMetaData() { Cursor cursor = metaIndex.find(pageStoreSession, null, null); // first, create all tables while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type == META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } // now create all secondary indexes // otherwise the table might not be created yet cursor = metaIndex.find(pageStoreSession, null, null); while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type != META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } }
private void readMetaData() { Cursor cursor = metaIndex.find(pageStoreSession, null, null); // first, create all tables while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type == META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } // now create all secondary indexes // otherwise the table might not be created yet cursor = metaIndex.find(pageStoreSession, null, null); while (cursor.next()) { Row row = cursor.get(); int type = row.getValue(1).getInt(); if (type != META_TYPE_DATA_INDEX) { addMeta(row, pageStoreSession, false); } } }
public PageDelegateIndex(RegularTable table, int id, String name, IndexType indexType, PageDataIndex mainIndex, boolean create, Session session) { IndexColumn[] cols = IndexColumn.wrap( new Column[] { table.getColumn(mainIndex.getMainIndexColumn())}); this.initBaseIndex(table, id, name, cols, indexType); this.mainIndex = mainIndex; if (!database.isPersistent() || id < 0) { throw DbException.throwInternalError("" + name); } PageStore store = database.getPageStore(); store.addIndex(this); if (create) { store.addMeta(this, session); } }
public PageDelegateIndex(RegularTable table, int id, String name, IndexType indexType, PageDataIndex mainIndex, boolean create, Session session) { IndexColumn[] cols = IndexColumn.wrap( new Column[] { table.getColumn(mainIndex.getMainIndexColumn())}); this.initBaseIndex(table, id, name, cols, indexType); this.mainIndex = mainIndex; if (!database.isPersistent() || id < 0) { throw DbException.throwInternalError("" + name); } PageStore store = database.getPageStore(); store.addIndex(this); if (create) { store.addMeta(this, session); } }
store.addMeta(this, session); PageBtreeLeaf root = PageBtreeLeaf.create(this, rootPageId, PageBtree.ROOT); store.logUndo(root, null);
store.addMeta(this, session); PageBtreeLeaf root = PageBtreeLeaf.create(this, rootPageId, PageBtree.ROOT); store.logUndo(root, null);
store.addMeta(this, session); PageDataLeaf root = PageDataLeaf.create(this, rootPageId, PageData.ROOT); store.update(root);