Search in sources :

Example 1 with AuxObject

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);
}
Also used : AuxObject(org.apache.derby.iapi.store.raw.AuxObject) FetchDescriptor(org.apache.derby.iapi.store.raw.FetchDescriptor) Qualifier(org.apache.derby.iapi.store.access.Qualifier) DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor) StorableFormatId(org.apache.derby.impl.store.access.StorableFormatId)

Aggregations

Qualifier (org.apache.derby.iapi.store.access.Qualifier)1 AuxObject (org.apache.derby.iapi.store.raw.AuxObject)1 FetchDescriptor (org.apache.derby.iapi.store.raw.FetchDescriptor)1 DataValueDescriptor (org.apache.derby.iapi.types.DataValueDescriptor)1 StorableFormatId (org.apache.derby.impl.store.access.StorableFormatId)1