public class MemoryPageStorage extends CachingPageStorage
CachingPageStorage.CachedPage
Constructor and Description |
---|
MemoryPageStorage(int pagesize) |
Modifier and Type | Method and Description |
---|---|
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(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
|
getPageSize
public int getNumPages()
PageStorage
getNumPages
in class PageStorage
public int createPage()
PageStorage
createPage
in class PageStorage
public void fsync(int pageid)
fsync
in class PageStorage
public void writePage(int pageid, byte[] buf, int ofs)
CachingPageStorage
writePage
in class CachingPageStorage
public void readPage(int pageid, byte[] buf, int ofs)
PageStorage
readPage
in class PageStorage
public void close()
PageStorage
close
in class PageStorage
public CachingPageStorage.CachedPage getPage(int pageid, boolean readBytes)
CachingPageStorage
getPage
in class CachingPageStorage