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

The region is defined by a root block, which either contains the entire data for the region (if it will fit), or contains a set of references to secondary blocks which contain the actual data. If the region is large enough, those secondary blocks themselves may be references, and so on.
Definition at line 58 of file BlockAccess.java.
Public Member Functions | |
| BlockAccess () | |
| Default public constructor. | |
| BlockAccess (PageManager file, long rootBlock) throws IOException | |
Construct a new BlockAccess attached to the specified block. | |
| void | init (PageManager file, long rootBlock) throws IOException |
| long | size () |
| Return the size of this region. | |
| void | resize (long newSize) throws IOException |
| Resize the region. | |
| void | write (long pos, byte[] buf, int offset, int len) throws IOException |
| Write into the data region. | |
| void | read (long pos, byte[] buf, int offset, int len) throws IOException |
| Read from the data region. | |
| void | close () |
| Finalization: We're done with this region. | |
| void | flush () |
| String | toString () |
Package Functions | |
| final int[] | radicesForDepth (int depth) |
| Build the radices array for a region of the specified depth. | |
| final long | getBlockRef (Page b, int pos, boolean isRoot) throws IOException |
| Return the specified block reference. | |
| final long | makeBlockRef (Page b, int pos, boolean isRoot) throws IOException |
| Return the specified block reference. | |
| final void | setBlockRef (Page b, int pos, long val, boolean isRoot) |
| Set the specified block reference. | |
| final int | refsForLevel (int level) |
| Return the number of blockrefs that will fit in a block. | |
| final int | bufLen () |
| Return the size of the data portion of the block. | |
| final String | toString (long page) |
Package Attributes | |
| PageManager | file |
| The underlying store. | |
| long | rootBlock |
| The 'root' block of this data area. | |
| long | size |
| int[] | radices = null |
| A vector of depth elements, indicating the size of the recursive sub-block at each level. | |
| byte[] | b1 = new byte[1] |
| int | depth = 0 |
| Depth of this data area. | |
| BlockPath | path = null |
| Path from root to leaf blocks. | |
| Object | fileLock = null |
| The file lock. | |
Static Package Attributes | |
| final int | HEADER_SIZE = 8 |
| final int | REF_SIZE = 8 |
Private Member Functions | |
| final BlockPath | getPath (long pos) throws IOException |
| final long | maxSizeForDepth (int level) |
| Return the maximum size for a region of the specified depth. | |
| final int | depthForSize (long size) |
| Return the depth necessary to represent a region of the specified size. | |
|
|
Default public constructor.
Definition at line 106 of file BlockAccess.java. |
|
||||||||||||
|
Construct a new
Definition at line 112 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.file, com.quadcap.sql.file.BlockAccess.init(), and com.quadcap.sql.file.BlockAccess.rootBlock. |
|
|
Return the size of the data portion of the block.
Definition at line 403 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.file, and com.quadcap.sql.file.PageManager.getPageSize(). Referenced by com.quadcap.sql.file.BlockAccess.depthForSize(), com.quadcap.sql.file.BlockAccess.maxSizeForDepth(), com.quadcap.sql.file.BlockAccess.radicesForDepth(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.refsForLevel(), com.quadcap.sql.file.BlockAccess.resize(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
Finalization: We're done with this region.
Implements com.quadcap.sql.file.RandomAccess. Definition at line 314 of file BlockAccess.java. |
|
|
Return the depth necessary to represent a region of the specified size.
Definition at line 426 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.bufLen(), com.quadcap.sql.file.BlockAccess.depthForSize(), and com.quadcap.sql.file.BlockAccess.HEADER_SIZE. Referenced by com.quadcap.sql.file.BlockAccess.depthForSize(), com.quadcap.sql.file.BlockAccess.init(), and com.quadcap.sql.file.BlockAccess.resize(). |
|
|
Implements com.quadcap.sql.file.RandomAccess. Definition at line 317 of file BlockAccess.java. |
|
||||||||||||||||
|
Return the specified block reference. This method treats the data portion of the block as an array of integer blockrefs.
Definition at line 350 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.getBlockRef(), com.quadcap.sql.file.BlockAccess.HEADER_SIZE, and com.quadcap.sql.file.BlockAccess.REF_SIZE. Referenced by com.quadcap.sql.file.BlockAccess.getBlockRef(), and com.quadcap.sql.file.BlockAccess.resize(). |
|
|
||||||||||||
|
||||||||||||||||
|
Return the specified block reference.
This method treats the data portion of the block as an array of long blockrefs. If the selected blockref is zero, this routine will allocate a new block and return the blockref of the newly created block, as well as update
Definition at line 369 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.file, com.quadcap.sql.file.BlockAccess.HEADER_SIZE, com.quadcap.sql.file.BlockAccess.makeBlockRef(), com.quadcap.sql.file.PageManager.newPage(), and com.quadcap.sql.file.BlockAccess.REF_SIZE. Referenced by com.quadcap.sql.file.BlockPath.getRefs(), com.quadcap.sql.file.BlockAccess.makeBlockRef(), and com.quadcap.sql.file.BlockPath.updatePath(). |
|
|
Return the maximum size for a region of the specified depth.
Definition at line 410 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.bufLen(), com.quadcap.sql.file.BlockAccess.HEADER_SIZE, and com.quadcap.sql.file.BlockAccess.maxSizeForDepth(). Referenced by com.quadcap.sql.file.BlockAccess.maxSizeForDepth(). |
|
|
Build the radices array for a region of the specified depth.
Definition at line 332 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.bufLen(), com.quadcap.sql.file.BlockAccess.radicesForDepth(), and com.quadcap.sql.file.BlockAccess.refsForLevel(). Referenced by com.quadcap.sql.file.BlockAccess.init(), com.quadcap.sql.file.BlockAccess.radicesForDepth(), and com.quadcap.sql.file.BlockAccess.resize(). |
|
||||||||||||||||||||
|
|
Return the number of blockrefs that will fit in a block.
Definition at line 396 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.bufLen(), com.quadcap.sql.file.BlockAccess.HEADER_SIZE, com.quadcap.sql.file.BlockAccess.REF_SIZE, and com.quadcap.sql.file.BlockAccess.refsForLevel(). Referenced by com.quadcap.sql.file.BlockAccess.radicesForDepth(), com.quadcap.sql.file.BlockAccess.refsForLevel(), and com.quadcap.sql.file.BlockAccess.resize(). |
|
|
||||||||||||||||||||
|
Set the specified block reference.
Definition at line 388 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.HEADER_SIZE, com.quadcap.sql.file.BlockAccess.REF_SIZE, com.quadcap.sql.file.BlockAccess.setBlockRef(), and com.quadcap.sql.file.Page.writeLong(). Referenced by com.quadcap.sql.file.BlockAccess.resize(), and com.quadcap.sql.file.BlockAccess.setBlockRef(). |
|
|
Return the size of this region.
Implements com.quadcap.sql.file.RandomAccess. Definition at line 142 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.read(). |
|
|
Definition at line 443 of file BlockAccess.java. References com.quadcap.sql.file.BlockAccess.depth, com.quadcap.sql.file.BlockAccess.path, com.quadcap.sql.file.BlockAccess.radices, and com.quadcap.sql.file.BlockAccess.rootBlock. Referenced by com.quadcap.sql.file.BlockAccess.resize(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
Definition at line 439 of file BlockAccess.java. |
|
||||||||||||||||||||
|
|
Definition at line 81 of file BlockAccess.java. |
|
|
Depth of this data area. A depth of zero indicates that the actual data area is entirely contained within the root block. A depth of one indicates that the data is contained in sub-blocks, and the root block contains the block numbers of the sub-blocks. Larger depths indicate that the sub-blocks contain pointers to other sub-blocks, etc. Definition at line 91 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockPath.BlockPath(), com.quadcap.sql.file.BlockAccess.getPath(), com.quadcap.sql.file.BlockAccess.init(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.resize(), com.quadcap.sql.file.BlockAccess.toString(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
The underlying store.
Definition at line 65 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.BlockAccess(), com.quadcap.sql.file.BlockAccess.bufLen(), com.quadcap.sql.file.BlockPath.getLeafBlock(), com.quadcap.sql.file.BlockPath.getRefs(), com.quadcap.sql.file.BlockAccess.init(), com.quadcap.sql.file.BlockAccess.makeBlockRef(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.resize(), com.quadcap.sql.file.BlockPath.updatePath(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
The file lock.
Definition at line 101 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.init(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.resize(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
Definition at line 59 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.depthForSize(), com.quadcap.sql.file.BlockAccess.getBlockRef(), com.quadcap.sql.file.BlockAccess.makeBlockRef(), com.quadcap.sql.file.BlockAccess.maxSizeForDepth(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.refsForLevel(), com.quadcap.sql.file.BlockAccess.resize(), com.quadcap.sql.file.BlockAccess.setBlockRef(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
Path from root to leaf blocks.
Definition at line 96 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.getPath(), and com.quadcap.sql.file.BlockAccess.toString(). |
|
|
A vector of depth elements, indicating the size of the recursive sub-block at each level.
Definition at line 79 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockPath.getPath(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.resize(), and com.quadcap.sql.file.BlockAccess.toString(). |
|
|
Definition at line 60 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.getBlockRef(), com.quadcap.sql.file.BlockAccess.makeBlockRef(), com.quadcap.sql.file.BlockAccess.refsForLevel(), and com.quadcap.sql.file.BlockAccess.setBlockRef(). |
|
|
The 'root' block of this data area. The format of this block is as follows: Bytes 0-3: The size of this data area, in bytes. Definition at line 72 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockAccess.BlockAccess(), com.quadcap.sql.file.BlockPath.getRefs(), com.quadcap.sql.file.BlockAccess.init(), com.quadcap.sql.file.BlockAccess.read(), com.quadcap.sql.file.BlockAccess.resize(), com.quadcap.sql.file.BlockAccess.toString(), and com.quadcap.sql.file.BlockAccess.write(). |
|
|
Definition at line 73 of file BlockAccess.java. Referenced by com.quadcap.sql.file.BlockFile.getBytes(), com.quadcap.sql.file.BlockAccess.init(), and com.quadcap.sql.file.BlockFile.updateBytes(). |