| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| protected CacheManager | containerCache
The container cache my container lives in. MT - Immutable |
| private long | |
| protected BaseDataFileFactory | dataFactory
My factory class. |
| protected int | |
| protected boolean | |
| protected static final int | |
| protected CacheManager | pageCache
The page cache I live in. MT - Immutable |
| protected byte[] | |
| protected boolean | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private CachedPage | Returns: The new object created with the input fid and transfered info.The format id of the new page. fid, PageKey The key of the new page. newIdentity)Convert this page to requested type, as defined by input format id. The current cache entry is a different format id than the requested type, change it. |
| public void | clean(boolean
True if the object will be removed remove)Implements org. Write the page to disk. |
| public void | clearIdentity()
Overrides org. Implements org. Put the object into the No Identity state. |
| public Cacheable | Returns: new page, higher levels have already checked the page number is valid for an open.Which page is this? key, Object details needed to create page like size,
format id, ... createParameter)Implements org. Find the container and then create the page in that container. |
| protected abstract void | |
| protected byte[] | Returns: The array of bytes that is the on disk version of page.Implements abstract org. Returns the page data array used to write on disk version. |
| protected abstract void | |
| protected void | initialize()
Overrides org. Initialize a CachedPage. |
| public boolean | Returns: true if changes have actually been made to the page in memory.Has the page or its header been modified. |
| public boolean | Returns: true if the page is dirty.Implements org. Is the page dirty? |
| public void | preDirty()
Implements abstract org. Set state to indicate the page or its header is about to be modified. |
| private void | readPage(FileContainer
the container to read the page from. myContainer, PageKey indentity (ie. page number) of the page to read newIdentity)read the page from disk into this CachedPage object. |
| protected void | releaseExclusive()
Overrides org. exclusive latch on page is being released. |
| public void | setContainerRowCount(long rowCount)
Implements abstract org. Set the number of rows in the container - the page uses this to decide whether it needs to aggressive set the container's row count when it changes. |
| protected void | |
| public final void | |
| public Cacheable | Returns: always true, higher levels have already checked the page number is valid for an open.The handle on the cacheable key)Implements org. Find the container and then read the page from that container. |
| protected void | setPageArray(int pageSize)
if the page size is different from the page buffer, then make a new page buffer and make subclass use the new page buffer |
| protected abstract void | |
| protected abstract void | |
| private void | |
| protected abstract void |
| alreadyReadPage | back to summary |
|---|---|
| protected boolean alreadyReadPage | |
| containerCache | back to summary |
|---|---|
| protected CacheManager containerCache The container cache my container lives in.
| |
| containerRowCount | back to summary |
|---|---|
| private long containerRowCount | |
| dataFactory | back to summary |
|---|---|
| protected BaseDataFileFactory dataFactory My factory class.
| |
| initialRowCount | back to summary |
|---|---|
| protected int initialRowCount | |
| isDirty | back to summary |
|---|---|
| protected boolean isDirty | |
| PAGE_FORMAT_ID_SIZE | back to summary |
|---|---|
| protected static final int PAGE_FORMAT_ID_SIZE | |
| pageCache | back to summary |
|---|---|
| protected CacheManager pageCache The page cache I live in.
| |
| pageData | back to summary |
|---|---|
| protected byte[] pageData | |
| preDirty | back to summary |
|---|---|
| protected boolean preDirty | |
| WRITE_NO_SYNC | back to summary |
|---|---|
| public static final int WRITE_NO_SYNC | |
| WRITE_SYNC | back to summary |
|---|---|
| public static final int WRITE_SYNC | |
| CachedPage | back to summary |
|---|---|
| public CachedPage() | |
| changeInstanceTo | back to summary |
|---|---|
| private CachedPage changeInstanceTo(int fid, PageKey newIdentity) throws StandardException Convert this page to requested type, as defined by input format id. The current cache entry is a different format id than the requested type, change it. This object is instantiated to the wrong subtype of cachedPage, this routine will create an object with the correct subtype, and transfer all pertinent information from this to the new correct object.
| |
| clean | back to summary |
|---|---|
| public void clean(boolean remove) throws StandardException Implements org. 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.
| |
| clearIdentity | back to summary |
|---|---|
| public void clearIdentity() Overrides org. Implements org. Doc from org. Put the object into the No Identity state.
| |
| createIdentity | back to summary |
|---|---|
| public Cacheable createIdentity(Object key, Object createParameter) throws StandardException Implements org. 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.
| |
| createPage | back to summary |
|---|---|
| protected abstract void createPage(PageKey id, PageCreationArgs args) throws StandardException | |
| getPageArray | back to summary |
|---|---|
| protected byte[] getPageArray() throws StandardException Implements abstract org. 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).
| |
| initFromData | back to summary |
|---|---|
| protected abstract void initFromData(FileContainer container, PageKey id) throws StandardException | |
| initialize | back to summary |
|---|---|
| protected void initialize() Overrides org. Initialize a CachedPage. Initialize the object, ie. perform work normally perfomed in constructor. Called by setIdentity() and createIdentity(). | |
| isActuallyDirty | back to summary |
|---|---|
| public boolean isActuallyDirty() Has the page or its header been modified. See comment on class header on meaning of isDirty and preDirty bits.
| |
| isDirty | back to summary |
|---|---|
| public boolean isDirty() Implements org. 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.
| |
| preDirty | back to summary |
|---|---|
| public void preDirty() Implements abstract org. 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. | |
| readPage | back to summary |
|---|---|
| private void readPage(FileContainer myContainer, PageKey newIdentity) throws StandardException read the page from disk into this CachedPage object. A page is read in from disk into the pageData array of this object, and then put in the cache.
| |
| releaseExclusive | back to summary |
|---|---|
| protected void releaseExclusive() Overrides org. 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 | back to summary |
|---|---|
| public void setContainerRowCount(long rowCount) Implements abstract org. Doc from org. Set the number of rows in the container - the page uses this to decide whether it needs to aggressive set the container's row count when it changes. | |
| setDirty | back to summary |
|---|---|
| protected void setDirty() Set state to indicate the page or its header has been modified. See comment on class header on meaning of isDirty and preDirty bits.
| |
| setFactory | back to summary |
|---|---|
| public final void setFactory(BaseDataFileFactory factory) | |
| setIdentity | back to summary |
|---|---|
| public Cacheable setIdentity(Object key) throws StandardException Implements org. Find the container and then read the page from that container. This is the way new pages enter the page cache.
| |
| setPageArray | back to summary |
|---|---|
| protected void setPageArray(int pageSize) if the page size is different from the page buffer, then make a new page buffer and make subclass use the new page buffer | |
| usePageBuffer | back to summary |
|---|---|
| protected abstract void usePageBuffer(byte[] buffer) | |
| writeFormatId | back to summary |
|---|---|
| protected abstract void writeFormatId(PageKey identity) throws StandardException | |
| writePage | back to summary |
|---|---|
| private void writePage(PageKey identity, boolean syncMe) throws StandardException write the page from this CachedPage object to disk.
| |
| writePage | back to summary |
|---|---|
| protected abstract void writePage(PageKey id) throws StandardException | |