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

The key is an Integer specifying the block number, while the data is a byte array containing the actual data.
Definition at line 55 of file Block.java.
Public Member Functions | |
| long | getPageNum () |
| Return this page's block number. | |
| void | init (Object store, long key) throws IOException |
| Initialize this block. | |
| final void | flush () throws IOException |
| Write the contents of the buffer back to the underlying store. | |
| final Object | getData () |
| From the Cacheable class, return the underlying data object. | |
| byte[] | getDataAndReset () |
Return a reference to the array containing the data for this block, and create a new buffer, so that the reference returned can be used in a subsequent setData call to another buffer. | |
| void | setData (Object obj) |
| From the Cacheable class, set the underlying data object. | |
| String | toString () |
| Only a debugging version implemented so far... | |
| final int | read (int pos, byte[] pbuf, int offset, int len) |
| Read a range of bytes from the page. | |
| final int | write (int pos, byte[] pbuf, int offset, int len) |
| Write a range of bytes to the page. | |
| final byte | readByte (int pos) |
| final void | writeByte (int pos, byte val) |
| final short | readShort (int pos) |
| Read a short (2-byte) value from the page. | |
| final void | writeShort (int pos, short val) |
| Write a short (2-byte) value to the page. | |
| final int | readInt (int pos) |
| Read an integer (4-byte) value from the page. | |
| final void | writeInt (int pos, int val) |
| Write an integer (4-byte) value to the page. | |
| final long | readLong (int pos) |
| Read a long (8-byte) value from the page. | |
| final void | writeLong (int pos, long val) |
| Write a long (8-byte) value to the page. | |
| final void | takeData (Page p) |
| Move the contents of the other page to this page, and zero out the other page. | |
| void | clear () |
| Zero this page. | |
| String | signature () |
Static Public Member Functions | |
| String | signature (byte[] buf) |
| String | signature (byte[] buf, int off, int cnt) |
| void | main (String args[]) |
Package Functions | |
| void | init () |
Private Attributes | |
| byte[] | buf |
|
|
Zero this page.
Implements com.quadcap.sql.file.Page. Definition at line 327 of file Block.java. References com.quadcap.sql.file.Block.buf. Referenced by com.quadcap.sql.file.BlockFile.newPage(). |
|
|
Write the contents of the buffer back to the underlying store.
Reimplemented from com.quadcap.sql.file.Cacheable. Definition at line 86 of file Block.java. References com.quadcap.sql.file.Block.buf, com.quadcap.sql.file.Block.getPageNum(), and com.quadcap.sql.file.BlockStore.write(). |
|
|
From the Cacheable class, return the underlying data object.
When used as a Implements com.quadcap.sql.file.Cacheable. Definition at line 109 of file Block.java. References com.quadcap.sql.file.Block.buf. Referenced by com.quadcap.sql.index.Bnode.moveKeys(). |
|
|
Return a reference to the array containing the data for this block, and create a new buffer, so that the reference returned can be used in a subsequent This allows the contents of one block to be moved to another block with a minimum of array copying. Definition at line 118 of file Block.java. References com.quadcap.sql.file.Block.buf. Referenced by com.quadcap.sql.file.BlockFile.freePage(), and com.quadcap.sql.file.Block.takeData(). |
|
|
Return this page's block number.
Implements com.quadcap.sql.file.Page. Definition at line 58 of file Block.java. Referenced by com.quadcap.sql.index.Bnode.checkMagic(), com.quadcap.sql.index.Bnode.display(), com.quadcap.sql.file.Block.flush(), com.quadcap.sql.index.Bnode.free(), com.quadcap.sql.file.Block.init(), and com.quadcap.sql.index.Bnode.propogateSplit(). |
|
|
Definition at line 334 of file Block.java. References com.quadcap.sql.file.Block.buf. |
|
||||||||||||
|
Initialize this block.
Create the buffer if necessary, and initialize the buffer contents from the underlying store. We assume that the
Reimplemented from com.quadcap.sql.file.Cacheable. Definition at line 70 of file Block.java. References com.quadcap.sql.file.BlockStore.blockSize, com.quadcap.sql.file.Block.buf, com.quadcap.sql.file.Block.getPageNum(), and com.quadcap.sql.file.BlockStore.read(). Referenced by com.quadcap.sql.file.Block.main(). |
|
|
Definition at line 359 of file Block.java. References com.quadcap.sql.file.Block.init(), com.quadcap.sql.file.Block.main(), com.quadcap.sql.file.Block.read(), com.quadcap.sql.file.Block.readInt(), and com.quadcap.sql.file.Block.writeInt(). Referenced by com.quadcap.sql.file.Block.main(). |
|
||||||||||||||||||||
|
Read a range of bytes from the page.
Implements com.quadcap.sql.file.Page. Definition at line 168 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.read(). Referenced by com.quadcap.sql.index.Bnode.dataAtPos(), com.quadcap.sql.file.BlockFile.dump(), com.quadcap.sql.index.Bnode.getBytes(), com.quadcap.sql.file.BlockFile.getBytes(), com.quadcap.sql.index.Bnode.keyAtPos(), com.quadcap.sql.file.Block.main(), com.quadcap.sql.file.SubPage.read(), and com.quadcap.sql.file.Block.read(). |
|
|
|
Read an integer (4-byte) value from the page.
Implements com.quadcap.sql.file.Page. Definition at line 264 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.readInt(). Referenced by com.quadcap.sql.file.BlockFile.dump(), com.quadcap.sql.index.Bnode.getBos(), com.quadcap.sql.index.Bnode.getCount(), com.quadcap.sql.index.Bnode.getFlags(), com.quadcap.sql.index.Bnode.getGarbage(), com.quadcap.sql.file.Block.main(), com.quadcap.sql.file.SubPage.readInt(), and com.quadcap.sql.file.Block.readInt(). |
|
|
Read a long (8-byte) value from the page.
Implements com.quadcap.sql.file.Page. Definition at line 296 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.readLong(). Referenced by com.quadcap.sql.file.BlockFile.BlockFile(), com.quadcap.sql.file.BlockFile.dump(), com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.BlockFile.freePage(), com.quadcap.sql.file.BlockFile.getBytes(), com.quadcap.sql.index.Bnode.getParent(), com.quadcap.sql.file.BlockFile.getUserBlock(), com.quadcap.sql.index.Bnode.longDataAtPos(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.BlockFile.newPage(), com.quadcap.sql.file.SubPage.readLong(), com.quadcap.sql.file.Block.readLong(), com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Log1.restoreBlocks(), com.quadcap.sql.file.BlockFile.revert(), and com.quadcap.sql.file.BlockFile.updateBytes(). |
|
|
Read a short (2-byte) value from the page.
Definition at line 232 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.readShort(). Referenced by com.quadcap.sql.file.BlockFile.dump(), com.quadcap.sql.index.Bnode.getKeyIndex(), and com.quadcap.sql.file.Block.readShort(). |
|
|
From the Cacheable class, set the underlying data object.
When used as a Implements com.quadcap.sql.file.Cacheable. Definition at line 135 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.setData(). Referenced by com.quadcap.sql.file.Block.setData(). |
|
||||||||||||||||
|
Definition at line 346 of file Block.java. |
|
|
Definition at line 343 of file Block.java. References com.quadcap.sql.file.Block.signature(). |
|
|
Definition at line 339 of file Block.java. References com.quadcap.sql.file.Block.buf. Referenced by com.quadcap.sql.file.BlockFile.signature(), and com.quadcap.sql.file.Block.signature(). |
|
|
Move the contents of the other page to this page, and zero out the other page.
Implements com.quadcap.sql.file.Page. Definition at line 323 of file Block.java. References com.quadcap.sql.file.Block.getDataAndReset(), and com.quadcap.sql.file.Block.takeData(). Referenced by com.quadcap.sql.index.Bnode.propogateSplit(), and com.quadcap.sql.file.Block.takeData(). |
|
|
Only a debugging version implemented so far...
Definition at line 152 of file Block.java. References com.quadcap.sql.file.Cacheable.getKey(). |
|
||||||||||||||||||||
|
Write a range of bytes to the page.
Implements com.quadcap.sql.file.Page. Definition at line 196 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.write(). Referenced by com.quadcap.sql.index.Bnode.insertKeyData(), com.quadcap.sql.file.BlockFile.putBytes(), com.quadcap.sql.file.BlockFile.updateBytes(), com.quadcap.sql.file.SubPage.write(), and com.quadcap.sql.file.Block.write(). |
|
||||||||||||
|
Definition at line 217 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.writeByte(). Referenced by com.quadcap.sql.file.Block.writeByte(), and com.quadcap.sql.index.Bnode.writeLenLen(). |
|
||||||||||||
|
Write an integer (4-byte) value to the page.
Implements com.quadcap.sql.file.Page. Definition at line 280 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.writeInt(). Referenced by com.quadcap.sql.file.Block.main(), com.quadcap.sql.index.Bnode.setBos(), com.quadcap.sql.index.Bnode.setCount(), com.quadcap.sql.index.Bnode.setFlags(), com.quadcap.sql.index.Bnode.setGarbage(), com.quadcap.sql.file.SubPage.writeInt(), and com.quadcap.sql.file.Block.writeInt(). |
|
||||||||||||
|
Write a long (8-byte) value to the page.
Implements com.quadcap.sql.file.Page. Definition at line 312 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.writeLong(). Referenced by com.quadcap.sql.file.SubPageManager.allocateNewBlock(), com.quadcap.sql.file.BlockFile.ensureLastBlock(), com.quadcap.sql.file.SubPageManager.freePage(), com.quadcap.sql.file.BlockFile.freePage(), com.quadcap.sql.file.BlockFile.getUserBlock(), com.quadcap.sql.file.SubPageManager.newPage(), com.quadcap.sql.file.BlockFile.newPage(), com.quadcap.sql.file.BlockFile.putBytes(), com.quadcap.sql.index.Bnode.setParent(), com.quadcap.sql.file.BlockFile.updateBytes(), com.quadcap.sql.file.SubPage.writeLong(), and com.quadcap.sql.file.Block.writeLong(). |
|
||||||||||||
|
Write a short (2-byte) value to the page.
Definition at line 248 of file Block.java. References com.quadcap.sql.file.Block.buf, and com.quadcap.sql.file.Block.writeShort(). Referenced by com.quadcap.sql.index.Bnode.setKeyIndex(), and com.quadcap.sql.file.Block.writeShort(). |
|