com.sun.electric.database.geometry.btree
Class CachingPageStorageWrapper.CachedPageImpl

java.lang.Object
  extended by com.sun.electric.database.geometry.btree.CachingPageStorage.CachedPage
      extended by com.sun.electric.database.geometry.btree.CachingPageStorageWrapper.CachedPageImpl
Enclosing class:
CachingPageStorageWrapper

public class CachingPageStorageWrapper.CachedPageImpl
extends CachingPageStorage.CachedPage

A page which is currently in the cache.


Method Summary
 void flush()
          Write the page to disk.
 byte[] getBuf()
          gets the byte[] for this page; it is okay to manipulate it directly, but you must call setDirty() and flush() afterwards
 int getPageId()
          the pageid of this cached page
 boolean isDirty()
          indicates whether or not the page is dirty
 void setDirty()
          Marks a page as dirty.
 void touch()
          Indicate that this page has been "used" for purposes of eviction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBuf

public byte[] getBuf()
Description copied from class: CachingPageStorage.CachedPage
gets the byte[] for this page; it is okay to manipulate it directly, but you must call setDirty() and flush() afterwards

Specified by:
getBuf in class CachingPageStorage.CachedPage

getPageId

public int getPageId()
Description copied from class: CachingPageStorage.CachedPage
the pageid of this cached page

Specified by:
getPageId in class CachingPageStorage.CachedPage

touch

public void touch()
Indicate that this page has been "used" for purposes of eviction. Touching an evicted page will un-evict it.

Specified by:
touch in class CachingPageStorage.CachedPage

setDirty

public void setDirty()
Marks a page as dirty. Any subsequent writes to this page must be accompanied by one of the following: 1. A call to isDirty() which returns false before the write. 2. A call to flush() before the write. 3. A call to setDirty() [and flush()] after the write. Note that in case #3 it is possible for a half-modified page to be written the disk. If this is a problem (for example, if the program crashes or power to the computer fails between the half-modified page being written and the next write), use #1 or #2 instead. Note that these restrictions apply even if asyncFlush is disabled, because reading in a new page may force the eviction of any page.

Specified by:
setDirty in class CachingPageStorage.CachedPage

flush

public void flush()
Write the page to disk. When this method returns, isDirty() is guaranteed to be false until the next call to setDirty().

Specified by:
flush in class CachingPageStorage.CachedPage

isDirty

public boolean isDirty()
indicates whether or not the page is dirty

Specified by:
isDirty in class CachingPageStorage.CachedPage