| java.lang.Object org.apache.derby.impl.store.raw.data.BasePage org.apache.derby.impl.store.raw.data.CachedPage
All known Subclasses: org.apache.derby.impl.store.raw.data.StoredPage,
CachedPage | abstract public class CachedPage extends BasePage implements Cacheable(Code) | | A base page that is cached.
Since there are multiple page formats, use this abstract class to implement
cacheable interface.
|
Method Summary | |
public void | clean(boolean remove) Write the page to disk.
MP - In a simple world we would just not allow clean until it held the
latch on the page. | public void | clearIdentity() | public Cacheable | createIdentity(Object key, Object createParameter) Find the container and then create the page in that container. | abstract protected void | createPage(PageKey id, int[] args) | protected byte[] | getPageArray() Returns the page data array used to write on disk version.
returns the page data array, that is actually written to the disk,
when the page is cleaned from the page cache. | abstract protected void | initFromData(FileContainer container, PageKey id) | protected void | initialize() Initialize a CachedPage.
Initialize the object, ie. | public boolean | isActuallyDirty() Has the page or its header been modified. | public boolean | isDirty() Is the page dirty?
The isDirty flag indicates if the pageData or pageHeader has been
modified. | public void | preDirty() Set state to indicate the page or its header is about to be modified. | protected void | releaseExclusive() exclusive latch on page is being released. | public void | setContainerRowCount(long rowCount) | protected void | setDirty() Set state to indicate the page or its header has been modified. | final public void | setFactory(BaseDataFileFactory factory) | public Cacheable | setIdentity(Object key) Find the container and then read the page from that container. | protected void | setPageArray(int pageSize) | abstract protected void | usePageBuffer(byte[] buffer) | abstract protected void | writeFormatId(PageKey identity) | abstract protected void | writePage(PageKey id) |
PAGE_FORMAT_ID_SIZE | final protected static int PAGE_FORMAT_ID_SIZE(Code) | | |
WRITE_NO_SYNC | final public static int WRITE_NO_SYNC(Code) | | |
WRITE_SYNC | final public static int WRITE_SYNC(Code) | | |
alreadyReadPage | protected boolean alreadyReadPage(Code) | | |
containerCache | protected CacheManager containerCache(Code) | | The container cache my container lives in.
MT - Immutable
|
initialRowCount | protected int initialRowCount(Code) | | |
isDirty | protected boolean isDirty(Code) | | |
pageData | protected byte[] pageData(Code) | | |
preDirty | protected boolean preDirty(Code) | | |
CachedPage | public CachedPage()(Code) | | |
clean | public void clean(boolean remove) throws StandardException(Code) | | Write the page to disk.
MP - In a simple world we would just not allow clean until it held the
latch on the page. But in order to fit into the cache system, we
don't have enough state around to just make clean() latch the page
while doing the I/O - but we still need someway to insure that no
changes happen to the page while the I/O is taking place.
Also someday it would be fine to allow reads of this page
while the I/O was taking place.
exception: StandardException - Error writing the page. See Also: Cacheable.clean |
clearIdentity | public void clearIdentity()(Code) | | |
createIdentity | public Cacheable createIdentity(Object key, Object createParameter) throws StandardException(Code) | | Find the container and then create the page in that container.
This is the process of creating a new page in a container, in that
case no need to read the page from disk - just need to initialize it
in the cache.
new page, higher levels have already checked the page number is valid for an open. Parameters: key - Which page is this? Parameters: createParameter - details needed to create page like size, format id, ... exception: StandardException - Standard exception policy. See Also: Cacheable.createIdentity |
getPageArray | protected byte[] getPageArray() throws StandardException(Code) | | Returns the page data array used to write on disk version.
returns the page data array, that is actually written to the disk,
when the page is cleaned from the page cache. Takes care of flushing
in-memory information to the array (like page header and format id info).
The array of bytes that is the on disk version of page. exception: StandardException - Standard exception policy. |
initialize | protected void initialize()(Code) | | Initialize a CachedPage.
Initialize the object, ie. perform work normally perfomed in
constructor. Called by setIdentity() and createIdentity().
|
isActuallyDirty | public boolean isActuallyDirty()(Code) | | Has the page or its header been modified.
See comment on class header on meaning of isDirty and preDirty bits.
true if changes have actually been made to the page in memory. |
isDirty | public boolean isDirty()(Code) | | Is the page dirty?
The isDirty flag indicates if the pageData or pageHeader has been
modified. The preDirty flag indicates that the pageData or the
pageHeader is about to be modified. The reason for these 2 flags
instead of just one is to accomodate checkpoint. After a clean
(latched) page sends a log record to the log stream but before that page
is dirtied by the log operation, a checkpoint could be taken. If so,
then the redoLWM will be after the log record but, without preDirty, the
cache cleaning will not have waited for the change. So the preDirty bit
is to stop the cache cleaning from skipping over this (latched) page
even though it has not really been modified yet.
true if the page is dirty. See Also: Cacheable.isDirty |
preDirty | public void preDirty()(Code) | | Set state to indicate the page or its header is about to be modified.
See comment on class header on meaning of isDirty and preDirty bits.
|
releaseExclusive | protected void releaseExclusive()(Code) | | exclusive latch on page is being released.
The only work done in CachedPage is to update the row count on the
container if it is too out of sync.
|
setContainerRowCount | public void setContainerRowCount(long rowCount)(Code) | | |
setDirty | protected void setDirty()(Code) | | Set state to indicate the page or its header has been modified.
See comment on class header on meaning of isDirty and preDirty bits.
|
usePageBuffer | abstract protected void usePageBuffer(byte[] buffer)(Code) | | |
Methods inherited from org.apache.derby.impl.store.raw.data.BasePage | final public static RecordHandle MakeRecordHandle(PageKey pkey, int recordHandleConstant) throws StandardException(Code)(Java Doc) abstract public boolean allowInsert()(Code)(Java Doc) abstract public int appendOverflowFieldHeader(DynamicByteArrayOutputStream logBuffer, RecordHandle overflowHandle) throws StandardException, IOException(Code)(Java Doc) final protected long bumpPageVersion()(Code)(Java Doc) final protected void bumpRecordCount(int number)(Code)(Java Doc) protected void cleanPageForReuse()(Code)(Java Doc) public void clearIdentity()(Code)(Java Doc) final protected void clearLastLogInstant()(Code)(Java Doc) public void compactRecord(RecordHandle handle) throws StandardException(Code)(Java Doc) abstract protected void compactRecord(RawTransaction t, int slot, int recordId) throws StandardException(Code)(Java Doc) public void copyAndPurge(Page destPage, int src_slot, int num_rows, int dest_slot) throws StandardException(Code)(Java Doc) public void deallocatePage() throws StandardException(Code)(Java Doc) public boolean delete(RecordHandle handle, LogicalUndo undo) throws StandardException(Code)(Java Doc) public RecordHandle deleteAtSlot(int slot, boolean delete, LogicalUndo undo) throws StandardException(Code)(Java Doc) abstract public void doUpdateAtSlot(RawTransaction t, int slot, int id, Object[] row, FormatableBitSet validColumns) throws StandardException(Code)(Java Doc) abstract public boolean entireRecordOnPage(int slot) throws StandardException(Code)(Java Doc) public RecordHandle fetch(RecordHandle handle, Object[] row, FormatableBitSet validColumns, boolean forUpdate) throws StandardException(Code)(Java Doc) final public RecordHandle fetchFieldFromSlot(int slot, int fieldId, Object column) throws StandardException(Code)(Java Doc) public RecordHandle fetchFromSlot(RecordHandle rh, int slot, Object[] row, FetchDescriptor fetchDesc, boolean ignoreDelete) throws StandardException(Code)(Java Doc) final public int fetchNumFields(RecordHandle handle) throws StandardException(Code)(Java Doc) public int fetchNumFieldsAtSlot(int slot) throws StandardException(Code)(Java Doc) protected void fillInIdentity(PageKey key)(Code)(Java Doc) public int findRecordById(int recordId, int slotHint)(Code)(Java Doc) public AuxObject getAuxObject()(Code)(Java Doc) final public StoredRecordHeader getHeaderAtSlot(int slot)(Code)(Java Doc) public Object getIdentity()(Code)(Java Doc) final public RecordHandle getInvalidRecordHandle()(Code)(Java Doc) final public LogInstant getLastLogInstant()(Code)(Java Doc) abstract protected BasePage getNewOverflowPage() throws StandardException(Code)(Java Doc) final public int getNextSlotNumber(RecordHandle handle) throws StandardException(Code)(Java Doc) abstract public BasePage getOverflowPageForInsert(int slot, Object[] row, FormatableBitSet validColumns, int startColumn) throws StandardException(Code)(Java Doc) abstract protected byte[] getPageArray() throws StandardException(Code)(Java Doc) public PageKey getPageId()(Code)(Java Doc) final public long getPageNumber()(Code)(Java Doc) public byte getPageStatus()(Code)(Java Doc) final public long getPageVersion()(Code)(Java Doc) final public RecordHandle getRecordHandle(int recordId)(Code)(Java Doc) final public RecordHandle getRecordHandleAtSlot(int slot)(Code)(Java Doc) abstract public int getRecordLength(int slot) throws IOException(Code)(Java Doc) abstract public int getReservedCount(int slot) throws IOException(Code)(Java Doc) final public int getSlotNumber(RecordHandle handle) throws StandardException(Code)(Java Doc) abstract public int getTotalSpace(int slot) throws StandardException(Code)(Java Doc) public void initPage(int initFlag, long pageOffset) throws StandardException(Code)(Java Doc) abstract public void initPage(LogInstant instant, byte status, int recordId, boolean overflow, boolean reuse) throws StandardException(Code)(Java Doc) protected void initialize()(Code)(Java Doc) protected void initializeHeaders(int numRecords)(Code)(Java Doc) final public RecordHandle insert(Object[] row, FormatableBitSet validColumns, byte insertFlag, int overflowThreshold) throws StandardException(Code)(Java Doc) public RecordHandle insertAllowOverflow(int slot, Object[] row, FormatableBitSet validColumns, int startColumn, byte insertFlag, int overflowThreshold, RecordHandle nextPortionHandle) throws StandardException(Code)(Java Doc) public RecordHandle insertAtSlot(int slot, Object[] row, FormatableBitSet validColumns, LogicalUndo undo, byte insertFlag, int overflowThreshold) throws StandardException(Code)(Java Doc) protected RecordHandle insertLongColumn(BasePage mainChainPage, LongColumnException lce, byte insertFlag) throws StandardException(Code)(Java Doc) protected RecordHandle insertNoOverflow(int slot, Object[] row, FormatableBitSet validColumns, LogicalUndo undo, byte insertFlag, int overflowThreshold) throws StandardException(Code)(Java Doc) abstract protected int internalDeletedRecordCount()(Code)(Java Doc) protected int internalNonDeletedRecordCount()(Code)(Java Doc) public boolean isDeletedAtSlot(int slot) throws StandardException(Code)(Java Doc) final protected boolean isDeletedOnPage(int slot)(Code)(Java Doc) public boolean isLatched()(Code)(Java Doc) abstract public boolean isOverflowPage()(Code)(Java Doc) public boolean lockAttributes(int flag, Hashtable attributes)(Code)(Java Doc) public void lockEvent(Latch lockInfo)(Code)(Java Doc) public boolean lockerAlwaysCompatible()(Code)(Java Doc) abstract public void logColumn(int slot, int fieldId, Object column, DynamicByteArrayOutputStream out, int overflowThreshold) throws StandardException, IOException(Code)(Java Doc) abstract public void logField(int slot, int fieldNumber, OutputStream out) throws StandardException, IOException(Code)(Java Doc) abstract public int logLongColumn(int slot, int recordId, Object column, DynamicByteArrayOutputStream out) throws StandardException, IOException(Code)(Java Doc) abstract public void logRecord(int slot, int flag, int recordId, FormatableBitSet validColumns, OutputStream out, RecordHandle headRowHandle) throws StandardException, IOException(Code)(Java Doc) abstract public int logRow(int slot, boolean forInsert, int recordId, Object[] row, FormatableBitSet validColumns, DynamicByteArrayOutputStream out, int startColumn, byte insertFlag, int realStartColumn, int realSpaceOnPage, int overflowThreshold) throws StandardException, IOException(Code)(Java Doc) final public RecordHandle makeRecordHandle(int recordHandleConstant) throws StandardException(Code)(Java Doc) abstract public int newRecordId() throws StandardException(Code)(Java Doc) abstract protected int newRecordId(int recordId) throws StandardException(Code)(Java Doc) abstract public int newRecordIdAndBump() throws StandardException(Code)(Java Doc) public int nonDeletedRecordCount()(Code)(Java Doc) abstract public void preDirty()(Code)(Java Doc) public void purgeAtSlot(int slot, int numpurges, boolean needDataLogged) throws StandardException(Code)(Java Doc) abstract public void purgeRecord(LogInstant instant, int slot, int recordId) throws StandardException, IOException(Code)(Java Doc) abstract protected void purgeRowPieces(RawTransaction t, int slot, RecordHandle headRowHandle, boolean needDataLogged) throws StandardException(Code)(Java Doc) final public int recordCount()(Code)(Java Doc) final public boolean recordExists(RecordHandle handle, boolean ignoreDelete) throws StandardException(Code)(Java Doc) abstract public StoredRecordHeader recordHeaderOnDemand(int slot)(Code)(Java Doc) protected void releaseExclusive()(Code)(Java Doc) protected void removeAndShiftDown(int slot)(Code)(Java Doc) public boolean requestCompatible(Object requestedQualifier, Object grantedQualifier)(Code)(Java Doc) abstract public void reserveSpaceForSlot(LogInstant instant, int slot, int spaceToReserve) throws StandardException, IOException(Code)(Java Doc) abstract protected void restorePortionLongColumn(OverflowInputStream fetchStream) throws StandardException, IOException(Code)(Java Doc) abstract protected boolean restoreRecordFromSlot(int slot, Object[] row, FetchDescriptor fetchDesc, RecordHandle rh, StoredRecordHeader recordHeader, boolean isHeadRow) throws StandardException(Code)(Java Doc) abstract public void restoreRecordFromStream(LimitObjectInput in, Object[] row) throws StandardException, IOException(Code)(Java Doc) public void setAuxObject(AuxObject obj)(Code)(Java Doc) abstract public void setContainerRowCount(long count)(Code)(Java Doc) public int setDeleteStatus(int slot, boolean delete) throws StandardException, IOException(Code)(Java Doc) abstract public void setDeleteStatus(LogInstant instant, int slot, boolean delete) throws StandardException, IOException(Code)(Java Doc) public void setExclusive(BaseContainerHandle requester) throws StandardException(Code)(Java Doc) boolean setExclusiveNoWait(BaseContainerHandle requester) throws StandardException(Code)(Java Doc) final protected void setHeaderAtSlot(int slot, StoredRecordHeader rh)(Code)(Java Doc) protected void setPageStatus(byte status)(Code)(Java Doc) abstract public void setPageStatus(LogInstant instant, byte status) throws StandardException(Code)(Java Doc) final public void setPageVersion(long v)(Code)(Java Doc) abstract public void setReservedSpace(LogInstant instant, int slot, int value) throws StandardException, IOException(Code)(Java Doc) protected StoredRecordHeader shiftUp(int low)(Code)(Java Doc) public boolean shouldReclaimSpace(int num_non_deleted_rows, int slot_just_deleted) throws StandardException(Code)(Java Doc) abstract public void skipField(ObjectInput in) throws StandardException, IOException(Code)(Java Doc) abstract public void skipRecord(ObjectInput in) throws StandardException, IOException(Code)(Java Doc) protected String slotTableToString()(Code)(Java Doc) abstract public boolean spaceForCopy(int num_rows, int[] spaceNeeded) throws StandardException(Code)(Java Doc) abstract public void storeField(LogInstant instant, int slot, int fieldId, ObjectInput in) throws StandardException, IOException(Code)(Java Doc) abstract public void storeRecord(LogInstant instant, int slot, boolean forInsert, ObjectInput in) throws StandardException, IOException(Code)(Java Doc) abstract public boolean unfilled()(Code)(Java Doc) public void unlatch()(Code)(Java Doc) public void unlockEvent(Latch lockInfo)(Code)(Java Doc) final public boolean update(RecordHandle handle, Object[] row, FormatableBitSet validColumns) throws StandardException(Code)(Java Doc) public void update(Observable obj, Object arg)(Code)(Java Doc) final public RecordHandle updateAtSlot(int slot, Object[] row, FormatableBitSet validColumns) throws StandardException(Code)(Java Doc) public RecordHandle updateFieldAtSlot(int slot, int fieldId, Object newValue, LogicalUndo undo) throws StandardException(Code)(Java Doc) abstract public void updateFieldOverflowDetails(RecordHandle handle, RecordHandle overflowHandle) throws StandardException(Code)(Java Doc) final protected void updateLastLogInstant(LogInstant instant)(Code)(Java Doc) abstract public void updateOverflowDetails(RecordHandle handle, RecordHandle overflowHandle) throws StandardException(Code)(Java Doc)
|
|
|