org.h2.index
Class PageBtreeNode
java.lang.Object
org.h2.util.CacheObject
org.h2.store.Page
org.h2.index.PageBtree
org.h2.index.PageBtreeNode
- All Implemented Interfaces:
- java.lang.Comparable<CacheObject>
public class PageBtreeNode
- extends PageBtree
A b-tree node page that contains index data. Format:
- page type: byte
- checksum: short
- parent page id (0 for root): int
- index id: varInt
- count of all children (-1 if not known): int
- entry count: short
- rightmost child page id: int
- entries (child page id: int, offset: short)
The row contains the largest key of the respective child,
meaning row[0] contains the largest key of child[0].
Fields inherited from class org.h2.store.Page |
changeCount, FLAG_LAST, TYPE_BTREE_LEAF, TYPE_BTREE_NODE, TYPE_DATA_LEAF, TYPE_DATA_NODE, TYPE_DATA_OVERFLOW, TYPE_EMPTY, TYPE_FREE_LIST, TYPE_STREAM_DATA, TYPE_STREAM_TRUNK |
Method Summary |
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 node page. |
protected void |
remapChildren()
Update the parent id of all children. |
java.lang.String |
toString()
|
void |
write()
Write the page. |
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)
- Read a b-tree node page.
- Parameters:
index
- the indexdata
- the datapageId
- the page id
- Returns:
- the page
remapChildren
protected void remapChildren()
- Description copied from class:
PageBtree
- Update the parent id of all children.
write
public void write()
- Description copied from class:
Page
- Write the page.
- Specified by:
write
in class Page
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
moveTo
public void moveTo(Session session,
int newPos)
- 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