use of org.apache.derby.iapi.store.raw.AuxObject in project derby by apache.
the class ControlRow method getControlRowForPage.
protected static ControlRow getControlRowForPage(ContainerHandle container, Page page) throws StandardException {
ControlRow cr = null;
// See if the control row is still cached with the page
// If so, just use the cached control row.
AuxObject auxobject = page.getAuxObject();
if (auxobject != null)
return (ControlRow) auxobject;
if (SanityManager.DEBUG)
SanityManager.ASSERT(page.recordCount() >= 1);
// No cached control row, so create a new one.
// Use the version field to determine the type of the row to
// create. This routine depends on the version field being the same
// number column in all control rows.
StorableFormatId version = new StorableFormatId();
DataValueDescriptor[] version_ret = new DataValueDescriptor[1];
version_ret[0] = version;
// TODO (mikem) - get rid of this new.
page.fetchFromSlot((RecordHandle) null, CR_SLOT, version_ret, new FetchDescriptor(1, CR_VERSION_BITSET, (Qualifier[][]) null), false);
// use format id to create empty instance of right Conglomerate class
cr = (ControlRow) Monitor.newInstanceFromIdentifier(version.getValue());
cr.page = page;
// call page specific initialization.
cr.controlRowInit();
// cache this Control row with the page in the cache.
page.setAuxObject(cr);
return (cr);
}
Aggregations