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

java.lang.Object
  extended by com.sun.electric.database.geometry.btree.PageStorage
      extended by com.sun.electric.database.geometry.btree.CachingPageStorage
          extended by com.sun.electric.database.geometry.btree.MemoryPageStorage

public class MemoryPageStorage
extends CachingPageStorage

A PageStorage that uses plain old memory.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.electric.database.geometry.btree.CachingPageStorage
CachingPageStorage.CachedPage
 
Constructor Summary
MemoryPageStorage(int pagesize)
           
 
Method Summary
 void close()
          close the PageStorage; invocation of any other methods after close() has undefined results
 int createPage()
          creates a new page with undefined contents; returns its pageid
 void fsync()
          no-op
 void fsync(int pageid)
          no-op
 int getNumPages()
          returns the number of pages; all pageids strictly less than this are valid
 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.
 void readPage(int pageid, byte[] buf, int ofs)
          reads a page
 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
getPageSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryPageStorage

public MemoryPageStorage(int pagesize)
Method Detail

getNumPages

public int getNumPages()
Description copied from class: PageStorage
returns the number of pages; all pageids strictly less than this are valid

Specified by:
getNumPages in class PageStorage

createPage

public int createPage()
Description copied from class: PageStorage
creates a new page with undefined contents; returns its pageid

Specified by:
createPage in class PageStorage

fsync

public void fsync(int pageid)
no-op

Specified by:
fsync in class PageStorage

fsync

public void fsync()
no-op

Specified by:
fsync in class PageStorage

writePage

public void writePage(int pageid,
                      byte[] buf,
                      int ofs)
Description copied from class: CachingPageStorage
Write a page through the cache to nonvolatile storage

Specified by:
writePage in class CachingPageStorage

readPage

public void readPage(int pageid,
                     byte[] buf,
                     int ofs)
Description copied from class: PageStorage
reads a page

Specified by:
readPage in class PageStorage

close

public void close()
Description copied from class: PageStorage
close the PageStorage; invocation of any other methods after close() has undefined results

Specified by:
close in class PageStorage

getPage

public CachingPageStorage.CachedPage getPage(int pageid,
                                             boolean readBytes)
Description copied from class: CachingPageStorage
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.

Specified by:
getPage in class CachingPageStorage