public abstract class BPlusIO<L> extends PageIO implements CompactablePageIO
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ITEMS_OFF |
protected int |
itemSize
All the items must be of fixed size.
|
COMMON_HEADER_END, CRC_OFF, MAX_PAYLOAD_SIZE, PAGE_ID_OFF, ROTATED_ID_PART_OFF, T_BPLUS_META, T_CACHE_ID_AWARE_DATA_REF_INNER, T_CACHE_ID_AWARE_DATA_REF_LEAF, T_CACHE_ID_AWARE_PENDING_REF_INNER, T_CACHE_ID_AWARE_PENDING_REF_LEAF, T_CACHE_ID_DATA_REF_MVCC_INNER, T_CACHE_ID_DATA_REF_MVCC_LEAF, T_DATA, T_DATA_METASTORAGE, T_DATA_PART, T_DATA_REF_INNER, T_DATA_REF_LEAF, T_DATA_REF_METASTORAGE_INNER, T_DATA_REF_METASTORAGE_LEAF, T_DATA_REF_MVCC_INNER, T_DATA_REF_MVCC_LEAF, T_H2_EX_REF_INNER_END, T_H2_EX_REF_INNER_START, T_H2_EX_REF_LEAF_END, T_H2_EX_REF_LEAF_START, T_H2_EX_REF_MVCC_INNER_END, T_H2_EX_REF_MVCC_INNER_START, T_H2_EX_REF_MVCC_LEAF_END, T_H2_EX_REF_MVCC_LEAF_START, T_H2_MVCC_REF_INNER, T_H2_MVCC_REF_LEAF, T_H2_REF_INNER, T_H2_REF_LEAF, T_META, T_METASTORE_INNER, T_METASTORE_LEAF, T_PAGE_LIST_META, T_PAGE_LIST_NODE, T_PAGE_UPDATE_TRACKING, T_PART_CNTRS, T_PART_META, T_PENDING_REF_INNER, T_PENDING_REF_LEAF, T_TX_LOG_INNER, T_TX_LOG_LEAF, TYPE_OFF, VER_OFF| Modifier | Constructor and Description |
|---|---|
protected |
BPlusIO(int type,
int ver,
boolean leaf,
boolean canGetRow,
int itemSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canGetRow() |
void |
compactPage(ByteBuffer page,
ByteBuffer out,
int pageSize)
Compacts page contents to the output buffer.
|
abstract void |
copyItems(long srcPageAddr,
long dstPageAddr,
int srcIdx,
int dstIdx,
int cnt,
boolean cpLeft)
Copy items from source page to destination page.
|
int |
getCount(long pageAddr) |
long |
getForward(long pageAddr) |
int |
getItemsEnd(long pageAddr) |
int |
getItemSize() |
abstract L |
getLookupRow(BPlusTree<L,?> tree,
long pageAddr,
int idx)
Get lookup row.
|
abstract int |
getMaxCount(long pageAddr,
int pageSize) |
long |
getRemoveId(long pageAddr) |
void |
initNewPage(long pageAddr,
long pageId,
int pageSize) |
byte[] |
insert(long pageAddr,
int idx,
L row,
byte[] rowBytes,
long rightId,
boolean needRowBytes) |
boolean |
isLeaf() |
boolean |
merge(BPlusIO<L> prntIo,
long prntPageAddr,
int prntIdx,
long leftPageAddr,
long rightPageAddr,
boolean emptyBranch,
int pageSize) |
abstract int |
offset(int idx) |
protected void |
printPage(long addr,
int pageSize,
GridStringBuilder sb) |
void |
remove(long pageAddr,
int idx,
int cnt) |
void |
restorePage(ByteBuffer compactPage,
int pageSize)
Restores the original page in place.
|
void |
setCount(long pageAddr,
int cnt) |
void |
setForward(long pageAddr,
long pageId) |
void |
setRemoveId(long pageAddr,
long rmvId) |
void |
splitExistingPage(long pageAddr,
int mid,
long fwdId) |
void |
splitForwardPage(long pageAddr,
long fwdId,
long fwdPageAddr,
int mid,
int cnt,
int pageSize) |
abstract void |
store(long dstPageAddr,
int dstIdx,
BPlusIO<L> srcIo,
long srcPageAddr,
int srcIdx)
Store row info from the given source.
|
byte[] |
store(long pageAddr,
int idx,
L row,
byte[] rowBytes,
boolean needRowBytes)
Store the needed info about the row in the page.
|
abstract void |
storeByOffset(long pageAddr,
int off,
L row)
Store the needed info about the row in the page.
|
void |
visit(long pageAddr,
IgniteInClosure<L> c) |
copyPage, deriveIndexPageType, getBPlusIO, getBPlusIO, getCompactedSize, getCompactedSize, getCompressedSize, getCompressedSize, getCompressionType, getCompressionType, getCrc, getCrc, getInnerVersions, getLeafVersions, getPageId, getPageId, getPageIO, getPageIO, getPageIO, getRotatedIdPart, getType, getType, getType, getVersion, getVersion, getVersion, isDataPageType, printPage, registerH2, registerH2ExtraInner, registerH2ExtraLeaf, registerTest, registerTest, setCompactedSize, setCompressedSize, setCompressionType, setCrc, setCrc, setPageId, setRotatedIdPart, setType, setVersion, toStringprotected static final int ITEMS_OFF
protected final int itemSize
protected BPlusIO(int type,
int ver,
boolean leaf,
boolean canGetRow,
int itemSize)
type - Page type.ver - Page format version.leaf - If this is a leaf IO.canGetRow - If we can get full row from this page.public final int getItemSize()
public void initNewPage(long pageAddr,
long pageId,
int pageSize)
initNewPage in class PageIOpageAddr - Page address.pageId - Page ID.pageSize - Page size.EncryptionSpi.encryptedSize(int)public final long getForward(long pageAddr)
pageAddr - Page address.public final void setForward(long pageAddr,
long pageId)
pageAddr - Page address.pageId - Forward page ID.public final long getRemoveId(long pageAddr)
pageAddr - Page address.public final void setRemoveId(long pageAddr,
long rmvId)
pageAddr - Page address.rmvId - Remove ID.public final int getCount(long pageAddr)
pageAddr - Page address.public final void setCount(long pageAddr,
int cnt)
pageAddr - Page address.cnt - Count.public final boolean canGetRow()
true If we can get the full row from this page using
method BPlusTree.getRow(BPlusIO, long, int).
Must always be true for leaf pages.public final boolean isLeaf()
true if it is a leaf page.public abstract int getMaxCount(long pageAddr,
int pageSize)
pageAddr - Page address.pageSize - Page size without encryption overhead.public final byte[] store(long pageAddr,
int idx,
L row,
byte[] rowBytes,
boolean needRowBytes)
throws IgniteCheckedException
pageAddr - Page address.idx - Index.row - Lookup or full row.rowBytes - Row bytes.needRowBytes - If we need stored row bytes.IgniteCheckedException - If failed.public abstract int offset(int idx)
idx - Index of element.public abstract void storeByOffset(long pageAddr,
int off,
L row)
throws IgniteCheckedException
pageAddr - Page address.off - Offset in bytes.row - Lookup or full row.IgniteCheckedException - If failed.public abstract void store(long dstPageAddr,
int dstIdx,
BPlusIO<L> srcIo,
long srcPageAddr,
int srcIdx)
throws IgniteCheckedException
dstPageAddr - Destination page address.dstIdx - Destination index.srcIo - Source IO.srcPageAddr - Source page address.srcIdx - Source index.IgniteCheckedException - If failed.public abstract L getLookupRow(BPlusTree<L,?> tree, long pageAddr, int idx) throws IgniteCheckedException
tree - Tree.pageAddr - Page address.idx - Index.IgniteCheckedException - If failed.public abstract void copyItems(long srcPageAddr,
long dstPageAddr,
int srcIdx,
int dstIdx,
int cnt,
boolean cpLeft)
throws IgniteCheckedException
srcPageAddr - Source page address.dstPageAddr - Destination page address.srcIdx - Source begin index.dstIdx - Destination begin index.cnt - Items count.cpLeft - Copy leftmost link (makes sense only for inner pages).IgniteCheckedException - If failed.public byte[] insert(long pageAddr,
int idx,
L row,
byte[] rowBytes,
long rightId,
boolean needRowBytes)
throws IgniteCheckedException
pageAddr - Page address.idx - Index.row - Row to insert.rowBytes - Row bytes.rightId - Page ID which will be to the right child for the inserted item.needRowBytes - If we need stored row bytes.IgniteCheckedException - If failed.public void splitForwardPage(long pageAddr,
long fwdId,
long fwdPageAddr,
int mid,
int cnt,
int pageSize)
throws IgniteCheckedException
pageAddr - Splitting page address.fwdId - Forward page ID.fwdPageAddr - Forward page address.mid - Bisection index.cnt - Initial elements count in the page being split.pageSize - Page size.IgniteCheckedException - If failed.public void splitExistingPage(long pageAddr,
int mid,
long fwdId)
pageAddr - Page address.mid - Bisection index.fwdId - New forward page ID.public void remove(long pageAddr,
int idx,
int cnt)
throws IgniteCheckedException
pageAddr - Page address.idx - Index.cnt - Count.IgniteCheckedException - If failed.public boolean merge(BPlusIO<L> prntIo, long prntPageAddr, int prntIdx, long leftPageAddr, long rightPageAddr, boolean emptyBranch, int pageSize) throws IgniteCheckedException
prntIo - Parent IO.prntPageAddr - Parent page address.prntIdx - Split key index in parent.leftPageAddr - Left page address.rightPageAddr - Right page address.emptyBranch - We are merging an empty branch.pageSize - Page size without encryption overhead.false If we were not able to merge.IgniteCheckedException - If failed.public void visit(long pageAddr,
IgniteInClosure<L> c)
pageAddr - Page address.c - Closure.protected void printPage(long addr,
int pageSize,
GridStringBuilder sb)
throws IgniteCheckedException
printPage in class PageIOaddr - Address.pageSize - Page size.sb - Sb.IgniteCheckedExceptionpublic int getItemsEnd(long pageAddr)
pageAddr - Page address.public void compactPage(ByteBuffer page, ByteBuffer out, int pageSize)
compactPage in interface CompactablePageIOpage - Page buffer.out - Output buffer.pageSize - Page size.public void restorePage(ByteBuffer compactPage, int pageSize)
restorePage in interface CompactablePageIOcompactPage - Compact page.pageSize - Page size.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020