com.sun.electric.database.geometry.btree
Class CachingPageStorage

java.lang.Object
  extended by com.sun.electric.database.geometry.btree.PageStorage
      extended by com.sun.electric.database.geometry.btree.CachingPageStorage
Direct Known Subclasses:
CachingPageStorageWrapper, MemoryPageStorage

public abstract class CachingPageStorage
extends PageStorage

API for a PageStorage with some sort of cache; the CachingPageStorage.CachedPage class provides an interface for interacting with the cache.


Nested Class Summary
 class CachingPageStorage.CachedPage
          A page which is currently in the cache; pages can be dirty or clean.
 
Constructor Summary
CachingPageStorage(int pageSize)
           
 
Method Summary
abstract  CachingPageStorage.CachedPage getPage(int pageid, boolean readBytes)
          Creates space in the cache for pageid, but only actually reads the bytes if readBytes is true; if the page was not already in the cache and readBytes is false, subsequent calls to setDirty()/flush() will overwrite data previously on the page.
abstract  void writePage(int pageid, byte[] buf, int ofs)
          Write a page through the cache to nonvolatile storage
 
Methods inherited from class com.sun.electric.database.geometry.btree.PageStorage
close, createPage, fsync, fsync, getNumPages, getPageSize, readPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingPageStorage

public CachingPageStorage(int pageSize)
Method Detail

getPage

public abstract CachingPageStorage.CachedPage getPage(int pageid,
                                                      boolean readBytes)
Creates space in the cache for pageid, but only actually reads the bytes if readBytes is true; if the page was not already in the cache and readBytes is false, subsequent calls to setDirty()/flush() will overwrite data previously on the page.


writePage

public abstract void writePage(int pageid,
                               byte[] buf,
                               int ofs)
Write a page through the cache to nonvolatile storage

Specified by:
writePage in class PageStorage