final class PageManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private FileHeader |
header
header data
|
private BlockIo |
headerBuf
recordFile header containing block
|
private RecordFile |
recordFile
our record recordFile
|
| Constructor and Description |
|---|
PageManager(RecordFile recordFile)
Creates a new page manager using the indicated record recordFile.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) long |
allocate(short type)
Allocates a page of the indicated type.
|
(package private) void |
close()
Closes the page manager.
|
(package private) void |
commit()
Commit all pending (in-memory) data by flushing the page manager.
|
(package private) void |
free(short type,
long recid)
Frees a page of the indicated type.
|
(package private) FileHeader |
getFileHeader()
Returns the recordFile header.
|
(package private) long |
getFirst(short type)
Returns the first page on the indicated list.
|
(package private) long |
getLast(short type)
Returns the last page on the indicated list.
|
(package private) long |
getNext(long block)
Returns the page following the indicated block
|
(package private) long |
getPrev(long block)
Returns the page before the indicated block
|
(package private) RecordFile |
getRecordFile() |
(package private) void |
rollback()
Flushes the page manager.
|
private RecordFile recordFile
private FileHeader header
private BlockIo headerBuf
PageManager(RecordFile recordFile) throws java.io.IOException
The - associated RecordFilejava.io.IOException - If there is an issue storing data into the recordFilelong allocate(short type)
throws java.io.IOException
The - page type we want to allocatejava.io.IOExceptionvoid free(short type,
long recid)
throws java.io.IOException
java.io.IOExceptionlong getNext(long block)
throws java.io.IOException
java.io.IOExceptionlong getPrev(long block)
throws java.io.IOException
java.io.IOExceptionlong getFirst(short type)
throws java.io.IOException
java.io.IOExceptionlong getLast(short type)
throws java.io.IOException
java.io.IOExceptionvoid commit()
throws java.io.IOException
RecordFile.commit() as well).java.io.IOExceptionvoid rollback()
throws java.io.IOException
RecordFile.commit() as well).java.io.IOExceptionvoid close()
throws java.io.IOException
java.io.IOExceptionFileHeader getFileHeader()
RecordFile getRecordFile()