Class BPlusInnerIO<L>

All Implemented Interfaces:
CompactablePageIO
Direct Known Subclasses:
IndexRowInnerIO, LongDataInnerIO, ObjectDataInnerIO

public abstract class BPlusInnerIO<L> extends BPlusIO<L>
Abstract IO routines for B+Tree inner pages.
  • Constructor Details

    • 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 Details

    • 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.