org.h2.index
Class PageBtreeLeaf
java.lang.Object
org.h2.util.CacheObject
org.h2.store.Record
org.h2.store.Page
org.h2.index.PageBtree
org.h2.index.PageBtreeLeaf
public class PageBtreeLeaf
- extends PageBtree
A b-tree leaf page that contains index data. Format:
- page type: byte
- checksum: short
- parent page id (0 for root): int
- index id: varInt
- entry count: short
- list of offsets: short
- data (key: varLong, value,...)
Method Summary |
int |
getByteCount(DataPage dummy)
Get the number of bytes required for the data if the given data page
would be used. |
void |
moveTo(Session session,
int newPos)
Copy the data to a new location, change the parent to point to the new
location, and free up the current page. |
static Page |
read(PageBtreeIndex index,
Data data,
int pageId)
Read a b-tree leaf page. |
java.lang.String |
toString()
|
void |
write(DataPage buff)
Write the record to the data page. |
Methods inherited from class org.h2.store.Record |
canRemove, commit, getSessionId, getStorageId, isDeleted, isEmpty, isLogWritten, prepareWrite, setDeleted, setLastLog, setLogWritten, setSessionId, setStorageId |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
read
public static Page read(PageBtreeIndex index,
Data data,
int pageId)
throws java.sql.SQLException
- Read a b-tree leaf page.
- Parameters:
index
- the indexdata
- the datapageId
- the page id
- Returns:
- the page
- Throws:
java.sql.SQLException
getByteCount
public int getByteCount(DataPage dummy)
- Description copied from class:
Record
- Get the number of bytes required for the data if the given data page
would be used.
- Specified by:
getByteCount
in class Record
- Parameters:
dummy
- the template data page
- Returns:
- the number of bytes
write
public void write(DataPage buff)
throws java.sql.SQLException
- Description copied from class:
Record
- Write the record to the data page.
- Specified by:
write
in class Record
- Parameters:
buff
- the data page
- Throws:
java.sql.SQLException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
moveTo
public void moveTo(Session session,
int newPos)
throws java.sql.SQLException
- Description copied from class:
Page
- Copy the data to a new location, change the parent to point to the new
location, and free up the current page.
- Specified by:
moveTo
in class Page
- Parameters:
session
- the sessionnewPos
- the new position
- Throws:
java.sql.SQLException