Search in sources :

Example 1 with BasePage

use of org.apache.derby.impl.store.raw.data.BasePage in project derby by apache.

the class InitPageOperation method getPageForRedoRecovery.

/*
	 * Override PageBasicOperation's getPageForRedoRecovery
	 */
/**
 *		If we are in load tran, this page may not exist for the container yet.
 *		We need to create it first.
 *
 *		This routine is called as the last resort of find page, the container
 *		handle has already been found and it is not dropped.
 *
 *		@exception StandardException Standard Derby policy.
 */
protected BasePage getPageForRedoRecovery(Transaction xact) throws StandardException {
    BasePage p = super.getPageForRedoRecovery(xact);
    if (p != null)
        return p;
    // create the page
    // RESOLVE: we need the page format to properly recreate an Alloc page
    // NEED TO UPGRADE this log record.
    p = (BasePage) containerHdl.reCreatePageForRedoRecovery(pageFormatId, getPageId().getPageNumber(), pageOffset);
    return p;
}
Also used : BasePage(org.apache.derby.impl.store.raw.data.BasePage)

Example 2 with BasePage

use of org.apache.derby.impl.store.raw.data.BasePage in project derby by apache.

the class DeleteOperation method restoreLoggedRow.

/*
	 * LogicalUndoable methods
	 */
/**
 *		Restore the row stored in the optional data of the log record.
 *
 *		@exception IOException error reading from log stream
 *		@exception StandardException Standard Derby error policy
 */
public void restoreLoggedRow(Object[] row, LimitObjectInput in) throws StandardException, IOException {
    Page p = null;
    try {
        // the optional data is written by the page in the same format it
        // stores record on the page,
        // only a page knows how to restore a logged row back to a storable row
        // first get the page where the insert went even though the row may no
        // longer be there
        p = getContainer().getPage(getPageId().getPageNumber());
        ((BasePage) p).restoreRecordFromStream(in, row);
    } finally {
        if (p != null) {
            p.unlatch();
            p = null;
        }
    }
}
Also used : Page(org.apache.derby.iapi.store.raw.Page) BasePage(org.apache.derby.impl.store.raw.data.BasePage) BasePage(org.apache.derby.impl.store.raw.data.BasePage)

Aggregations

BasePage (org.apache.derby.impl.store.raw.data.BasePage)2 Page (org.apache.derby.iapi.store.raw.Page)1