![]() |
Quadcap Embeddable Database |
Inheritance diagram for com.quadcap.sql.file.SubPageManager:

Definition at line 56 of file SubPageManager.java.
Public Member Functions | |
| SubPageManager (BlockFile file, int pageShift, long rootBlock) throws IOException | |
| Construct a new sub-page manager bound to the specified block file. | |
| long | newPage () throws IOException |
| Allocate a new block. | |
| void | freePage (long block) throws IOException |
| Free a block. | |
| final int | pageOffset (long page) |
| Return the byte offset of this page in the base block. | |
| Page | getPage (long block) throws IOException |
| Return the specified page. | |
| Object | getLock () |
| Return the (file) lock. | |
| final int | getPageSize () |
| Return this manager's block size. | |
| RandomAccessInputStream | getInputStream (long block) throws IOException |
| Return a new input stream, reading from the region with the specified root block. | |
| RandomAccessOutputStream | getOutputStream (long block) throws IOException |
| Return a new output stream, writing to the region with the specified root block. | |
| RandomAccess | getStream (long blockRef) throws IOException |
| void | freeStream (long page) throws IOException |
| Destroy the stream with the specified root page and free up the storage it was using. | |
| String | toString () |
| Return a displayable representation for this object. | |
Static Public Member Functions | |
| final long | pageBlock (long page) |
| Return the number of the block that contains this page. | |
| String | toString (long page) |
Package Functions | |
| final long | makePageNo (long blk, long page) |
Static Package Functions | |
| final long | fIns (long v, int[] f) |
| final long | fMask (int[] f) |
| final long | fEnd (int[] f) |
| final long | fExt (long v, int[] f) |
| final int | pageShift (long page) |
| Return the page shift for this page. | |
Package Attributes | |
| BlockFile | file |
| long | rootBlock |
| rootBlock is the root block of the entire block file, and will always be zero in this implementation. | |
| int | pageSize |
| The size of a subpage. | |
| int | pageShift |
| The page shift (file.pageSize >> pageShift == pageSize). | |
| int | offset |
| The offset into the root block of our freelist head. | |
| int | pagesPerBlock |
| (1 << pageShift) | |
Static Package Attributes | |
| final long | PAGE_FREE = 0xabcddbca5438182fL |
| int[] | PAGE_SHIFT = {63,4} |
| Sub-page numbers are encoded as follows:. | |
| int[] | PAGE_NUM = {59,16} |
| int[] | BLOCK_NUM = {43,44} |
Private Member Functions | |
| final long | allocateNewBlock () throws IOException |
| Allocate new block and slice it up into sub-pages. | |
|
||||||||||||||||
|
Construct a new sub-page manager bound to the specified block file.
Definition at line 82 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.file, com.quadcap.sql.file.BlockFile.getPageSize(), com.quadcap.sql.file.SubPageManager.pageShift, com.quadcap.sql.file.SubPageManager.pageSize, and com.quadcap.sql.file.SubPageManager.rootBlock. |
|
|
Allocate new block and slice it up into sub-pages. Link the sub-pages together and return the head of the list. Lock must be held! Definition at line 196 of file SubPageManager.java. References com.quadcap.sql.file.Cacheable.decrRefCount(), com.quadcap.sql.file.Page.decrRefCount(), com.quadcap.sql.file.SubPageManager.file, com.quadcap.sql.file.BlockFile.getBlock(), com.quadcap.sql.file.SubPageManager.getPage(), com.quadcap.sql.file.SubPageManager.makePageNo(), com.quadcap.sql.file.BlockFile.newPage(), com.quadcap.sql.file.SubPageManager.PAGE_FREE, com.quadcap.sql.file.SubPageManager.pagesPerBlock, com.quadcap.sql.file.SubPageManager.toString(), com.quadcap.sql.file.Page.writeLong(), and com.quadcap.sql.file.Block.writeLong(). Referenced by com.quadcap.sql.file.SubPageManager.newPage(). |
|
|
Definition at line 255 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.fEnd(). Referenced by com.quadcap.sql.file.SubPageManager.fEnd(), and com.quadcap.sql.file.SubPageManager.fIns(). |
|
||||||||||||
|
Definition at line 258 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.fExt(). Referenced by com.quadcap.sql.file.SubPageManager.fExt(). |
|
||||||||||||
|
Definition at line 249 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.fEnd(), com.quadcap.sql.file.SubPageManager.fIns(), and com.quadcap.sql.file.SubPageManager.fMask(). Referenced by com.quadcap.sql.file.SubPageManager.fIns(). |
|
|
Definition at line 252 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.fMask(). Referenced by com.quadcap.sql.file.SubPageManager.fIns(), and com.quadcap.sql.file.SubPageManager.fMask(). |
|
|
|
Destroy the stream with the specified root page and free up the storage it was using.
Definition at line 396 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.file, com.quadcap.sql.file.BlockFile.fileLock, com.quadcap.sql.file.SubPageManager.freeStream(), and com.quadcap.sql.file.RandomAccess.resize(). Referenced by com.quadcap.sql.file.SubPageManager.freeStream(). |
|
|
Return a new input stream, reading from the region with the specified root block.
Definition at line 362 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.getInputStream(), and com.quadcap.sql.file.SubPageManager.getStream(). Referenced by com.quadcap.sql.file.SubPageManager.getInputStream(). |
|
|
Return the (file) lock.
Implements com.quadcap.sql.file.PageManager. Definition at line 344 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.file, and com.quadcap.sql.file.BlockFile.getLock(). |
|
|
Return a new output stream, writing to the region with the specified root block.
Definition at line 377 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.getOutputStream(), and com.quadcap.sql.file.SubPageManager.getStream(). Referenced by com.quadcap.sql.file.SubPageManager.getOutputStream(). |
|
|
Return the specified page.
Implements com.quadcap.sql.file.PageManager. Definition at line 334 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.getPage(). Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.SubPageManager.getPage(), and com.quadcap.sql.file.SubPageManager.newPage(). |
|
|
Return this manager's block size.
Implements com.quadcap.sql.file.PageManager. Definition at line 349 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.pageSize. |
|
|
Definition at line 383 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.getStream(). Referenced by com.quadcap.sql.file.SubPageManager.getInputStream(), com.quadcap.sql.file.SubPageManager.getOutputStream(), and com.quadcap.sql.file.SubPageManager.getStream(). |
|
||||||||||||
|
Definition at line 262 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.BLOCK_NUM, com.quadcap.sql.file.SubPageManager.makePageNo(), com.quadcap.sql.file.SubPageManager.PAGE_NUM, com.quadcap.sql.file.SubPageManager.PAGE_SHIFT, and com.quadcap.sql.file.SubPageManager.pageShift. Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), and com.quadcap.sql.file.SubPageManager.makePageNo(). |
|
|
Allocate a new block.
Implements com.quadcap.sql.file.PageManager. Definition at line 99 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.Page.clear(), com.quadcap.sql.file.Cacheable.decrRefCount(), com.quadcap.sql.file.Page.decrRefCount(), com.quadcap.sql.file.SubPageManager.file, com.quadcap.sql.file.BlockFile.fileLock, com.quadcap.sql.file.BlockFile.getBlock(), com.quadcap.sql.file.SubPageManager.getPage(), com.quadcap.sql.file.SubPageManager.offset, com.quadcap.sql.file.SubPageManager.PAGE_FREE, com.quadcap.sql.file.SubPageManager.pageShift, com.quadcap.sql.file.SubPageManager.pageSize, com.quadcap.sql.file.Page.read(), com.quadcap.sql.file.Page.readLong(), com.quadcap.sql.file.Block.readLong(), com.quadcap.sql.file.SubPageManager.rootBlock, com.quadcap.sql.file.SubPageManager.toString(), and com.quadcap.sql.file.Block.writeLong(). |
|
|
Return the number of the block that contains this page.
Definition at line 291 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.BLOCK_NUM, and com.quadcap.sql.file.SubPageManager.pageBlock(). Referenced by com.quadcap.sql.file.SubPageManager.pageBlock(). |
|
|
Return the byte offset of this page in the base block.
Definition at line 314 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.PAGE_NUM, com.quadcap.sql.file.SubPageManager.pageOffset(), and com.quadcap.sql.file.SubPageManager.pageSize. Referenced by com.quadcap.sql.file.SubPageManager.pageOffset(), and com.quadcap.sql.file.SubPage.SubPage(). |
|
|
Return the page shift for this page.
Definition at line 324 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.PAGE_SHIFT, and com.quadcap.sql.file.SubPageManager.pageShift. |
|
|
Definition at line 412 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.PAGE_NUM. |
|
|
Return a displayable representation for this object.
Definition at line 407 of file SubPageManager.java. References com.quadcap.sql.file.SubPageManager.offset, com.quadcap.sql.file.SubPageManager.pageSize, and com.quadcap.sql.file.SubPageManager.rootBlock. Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.SubPageManager.freePage(), and com.quadcap.sql.file.SubPageManager.newPage(). |
|
|
Definition at line 246 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.makePageNo(), and com.quadcap.sql.file.SubPageManager.pageBlock(). |
|
|
Definition at line 57 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.SubPageManager.freeStream(), com.quadcap.sql.file.SubPageManager.getLock(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.SubPage.SubPage(), and com.quadcap.sql.file.SubPageManager.SubPageManager(). |
|
|
The offset into the root block of our freelist head.
Definition at line 71 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.SubPageManager.newPage(), and com.quadcap.sql.file.SubPageManager.toString(). |
|
|
Definition at line 77 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.SubPageManager.freePage(), and com.quadcap.sql.file.SubPageManager.newPage(). |
|
|
Definition at line 241 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.makePageNo(), com.quadcap.sql.file.SubPageManager.pageOffset(), and com.quadcap.sql.file.SubPageManager.toString(). |
|
|
Sub-page numbers are encoded as follows:.
sub_page {
pageShift bit4
pageNum bit16
blockNum bit44
}
This has the desirable property of being backward compatible with the pre-sub-page block numbers, which will have pageShift and pageNum equal to zero. Definition at line 240 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.makePageNo(), and com.quadcap.sql.file.SubPageManager.pageShift(). |
|
|
The page shift (file.pageSize >> pageShift == pageSize).
Definition at line 68 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.SubPageManager.makePageNo(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.SubPageManager.pageShift(), and com.quadcap.sql.file.SubPageManager.SubPageManager(). |
|
|
The size of a subpage.
Definition at line 65 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPage.clear(), com.quadcap.sql.file.SubPageManager.getPageSize(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.SubPageManager.pageOffset(), com.quadcap.sql.file.SubPageManager.SubPageManager(), com.quadcap.sql.file.SubPage.takeData(), and com.quadcap.sql.file.SubPageManager.toString(). |
|
|
(1 << pageShift)
Definition at line 74 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(). |
|
|
rootBlock is the root block of the entire block file, and will always be zero in this implementation.
Definition at line 62 of file SubPageManager.java. Referenced by com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.SubPageManager.SubPageManager(), and com.quadcap.sql.file.SubPageManager.toString(). |