org.apache.ignite.internal.processors.cache.persistence.tree.io

## Class BPlusInnerIO<L>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO
  - - org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO<L>
    - - org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusInnerIO<L>

All Implemented Interfaces:
  CompactablePageIO

Direct Known Subclasses:
  AbstractDataInnerIO, AbstractPendingEntryInnerIO, IndexStorageImpl.MetaStoreInnerIO, MetastorageInnerIO, TxLogInnerIO

    public abstract class BPlusInnerIO<L>
    extends BPlusIO<L>

Abstract IO routines for B+Tree inner pages.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO

`ITEMS_OFF, itemSize`

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO

`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`

### Constructor Summary

Constructors
`protected` `BPlusInnerIO(int type, int ver, boolean canGetRow, int itemSize)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `copyItems(long srcPageAddr, long dstPageAddr, int srcIdx, int dstIdx, int cnt, boolean cpLeft)` Copy items from source page to destination page.
`long` `getLeft(long pageAddr, int idx)`
`int` `getMaxCount(long pageAddr, int pageSize)`
`long` `getRight(long pageAddr, int idx)`
`byte[]` `initNewRoot(long newRootPageAddr, long newRootId, long leftChildId, L row, byte[] rowBytes, long rightChildId, int pageSize, boolean needRowBytes)`
`byte[]` `insert(long pageAddr, int idx, L row, byte[] rowBytes, long rightId, boolean needRowBytes)`
`int` `offset(int idx)`
`void` `setLeft(long pageAddr, int idx, long pageId)`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO

`canGetRow, compactPage, getCount, getForward, getItemsEnd, getItemSize, getLookupRow, getRemoveId, initNewPage, isLeaf, merge, printPage, remove, restorePage, setCount, setForward, setRemoveId, splitExistingPage, splitForwardPage, store, store, storeByOffset, visit`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO

`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, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### BPlusInnerIO

    protected BPlusInnerIO(int type,
                           int ver,
                           boolean canGetRow,
                           int itemSize)

Parameters:
  `type` - Page type.
  `ver` - Page format version.
  `canGetRow` - If we can get full row from this page.
  `itemSize` - Single item size on page.

### Method Detail

#### getMaxCount

    public int getMaxCount(long pageAddr,
                           int pageSize)

Specified by:
  `getMaxCount` in class `BPlusIO<L>`
Parameters:
  `pageAddr` - Page address.
  `pageSize` - Page size without encryption overhead.
Returns:
  Max items count.

#### getLeft

    public final long getLeft(long pageAddr,
                              int idx)

Parameters:
  `pageAddr` - Page address.
  `idx` - Index.
Returns:
  Page ID.

#### setLeft

    public final void setLeft(long pageAddr,
                              int idx,
                              long pageId)

Parameters:
  `pageAddr` - Page address.
  `idx` - Index.
  `pageId` - Page ID.

#### getRight

    public final long getRight(long pageAddr,
                               int idx)

Parameters:
  `pageAddr` - Page address.
  `idx` - Index.
Returns:
  Page ID.

#### copyItems

    public final void copyItems(long srcPageAddr,
                                long dstPageAddr,
                                int srcIdx,
                                int dstIdx,
                                int cnt,
                                boolean cpLeft)
                         throws IgniteCheckedException

Copy items from source page to destination page. Both pages must be of the same type and the same version.

Specified by:
  `copyItems` in class `BPlusIO<L>`
Parameters:
  `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).
Throws:
  `IgniteCheckedException` - If failed.

#### offset

    public final int offset(int idx)

Specified by:
  `offset` in class `BPlusIO<L>`
Parameters:
  `idx` - Index of element.
Returns:
  Offset from byte buffer begin in bytes.

#### insert

    public byte[] insert(long pageAddr,
                         int idx,
                         L row,
                         byte[] rowBytes,
                         long rightId,
                         boolean needRowBytes)
                  throws IgniteCheckedException

Overrides:
  `insert` in class `BPlusIO<L>`
Parameters:
  `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.
Returns:
  Row bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### initNewRoot

    public byte[] initNewRoot(long newRootPageAddr,
                              long newRootId,
                              long leftChildId,
                              L row,
                              byte[] rowBytes,
                              long rightChildId,
                              int pageSize,
                              boolean needRowBytes)
                       throws IgniteCheckedException

Parameters:
  `newRootPageAddr` - New root page address.
  `newRootId` - New root ID.
  `leftChildId` - Left child ID.
  `row` - Moved up row.
  `rowBytes` - Bytes.
  `rightChildId` - Right child ID.
  `pageSize` - Page size.
  `needRowBytes` - If we need row bytes back.
Returns:
  Row bytes.
Throws:
  `IgniteCheckedException` - If failed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020