public class FilePageStorage extends PageStorage
Modifier and Type | Method and Description |
---|---|
void |
close()
close the PageStorage; invocation of any other methods after close() has undefined results
|
static FilePageStorage |
create()
Create a new FilePageStorage; no PageStorage(RandomAccessFile)
constructor is provided because the on-disk format is not yet
stable.
|
int |
createPage()
creates a new page with undefined contents; returns its pageid
|
void |
fsync(int pageid)
ensure that the designated page is written to nonvolatile storage
|
int |
getNumPages()
returns the number of pages; all pageids strictly less than this are valid
|
void |
readPage(int pageid,
byte[] buf,
int ofs)
reads a page
|
void |
writePage(int pageid,
byte[] buf,
int ofs)
writes a page; throws an exception if the page did not exist
|
getPageSize
public static FilePageStorage create()
public int getNumPages()
PageStorage
getNumPages
in class PageStorage
public int createPage()
PageStorage
createPage
in class PageStorage
public void writePage(int pageid, byte[] buf, int ofs)
PageStorage
writePage
in class PageStorage
public void readPage(int pageid, byte[] buf, int ofs)
PageStorage
readPage
in class PageStorage
public void fsync(int pageid)
PageStorage
fsync
in class PageStorage
public void close()
PageStorage
close
in class PageStorage