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

## Class PageMetaIO

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO
  - - org.apache.ignite.internal.processors.cache.persistence.tree.io.PageMetaIO

Direct Known Subclasses:
  `PageMetaIOV2`, `PagePartitionMetaIO`

    public class PageMetaIO
    extends PageIO

### Field Summary

Fields
`static IOVersions<PageMetaIO>` `VERSIONS`

### 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_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_DEFRAG_LINK_MAPPING_INNER, T_DEFRAG_LINK_MAPPING_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_REF_INNER, T_H2_REF_LEAF, T_MARKER_PAGE, 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, TYPE_OFF, VER_OFF`

### Constructor Summary

Constructors
`` `PageMetaIO​(int ver)`
`protected` `PageMetaIO​(int type, int ver)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`int` `getCandidatePageCount​(long pageAddr)`
`int` `getFreeSpace​(int pageSize, long pageAddr)` Count of bytes that is currently free in this page and possibly can be used to place additional payload.
`int` `getLastAllocatedPageCount​(long pageAddr)` Gets last allocated pages count by provided address
`int` `getLastAllocatedPageCount​(@NotNull ByteBuffer buf)` Gets last allocated pages count from given buffer
`long` `getLastSuccessfulFullSnapshotId​(long pageAddr)` Deprecated. Will be removed at 3.0.
`long` `getLastSuccessfulSnapshotId​(long pageAddr)` Deprecated. Will be removed at 3.0.
`long` `getLastSuccessfulSnapshotTag​(long pageAddr)` Deprecated. Will be removed at 3.0.
`long` `getNextSnapshotTag​(long pageAddr)` Deprecated. Will be removed at 3.0.
`long` `getReuseListRoot​(long pageAddr)`
`long` `getTreeRoot​(long pageAddr)`
`void` `initNewPage​(long pageAddr, long pageId, int pageSize, PageMetrics metrics)`
`protected void` `printPage​(long addr, int pageSize, GridStringBuilder sb)`
`boolean` `setCandidatePageCount​(long pageAddr, int pageCnt)`
`void` `setLastAllocatedPageCount​(long pageAddr, int pageCnt)` Sets last allocated pages count, used to save and observe previous allocated count
`void` `setLastSuccessfulFullSnapshotId​(long pageAddr, long lastSuccessfulFullSnapshotId)` Deprecated. Will be removed at 3.0.
`void` `setLastSuccessfulSnapshotId​(long pageAddr, long lastSuccessfulSnapshotId)` Deprecated. Will be removed at 3.0.
`void` `setLastSuccessfulSnapshotTag​(long pageAddr, long lastSuccessfulSnapshotTag)` Deprecated. Will be removed at 3.0.
`void` `setNextSnapshotTag​(long pageAddr, long nextSnapshotTag)` Deprecated. Will be removed at 3.0.
`void` `setReuseListRoot​(long pageAddr, long pageId)`
`void` `setTreeRoot​(long pageAddr, long treeRoot)`

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

`assertPageType, assertPageType, 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, isIndexPage, 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`

### Field Detail

#### VERSIONS

    public static final IOVersions<PageMetaIO> VERSIONS

### Constructor Detail

#### PageMetaIO

    public PageMetaIO​(int ver)

Parameters:
  `ver` - Page format version.

#### PageMetaIO

    protected PageMetaIO​(int type,
                         int ver)

Parameters:
  `type` - Type.
  `ver` - Version.

### Method Detail

#### initNewPage

    public void initNewPage​(long pageAddr,
                            long pageId,
                            int pageSize,
                            PageMetrics metrics)

Overrides:
  `initNewPage` in class `PageIO`
Parameters:
  `pageAddr` - Page address.
  `pageId` - Page ID.
  `pageSize` - Page size.
  `metrics` - Page metrics for tracking page allocation. Can be `null` if no tracking is required.
See Also:
  `EncryptionSpi.encryptedSize(int)`

#### getTreeRoot

    public long getTreeRoot​(long pageAddr)

Parameters:
  `pageAddr` - Page address.
Returns:
  Tree root page.

#### setTreeRoot

    public void setTreeRoot​(long pageAddr,
                            long treeRoot)

Parameters:
  `pageAddr` - Page address.
  `treeRoot` - Tree root

#### getReuseListRoot

    public long getReuseListRoot​(long pageAddr)

Parameters:
  `pageAddr` - Page address.
Returns:
  Reuse list root page.

#### setReuseListRoot

    public void setReuseListRoot​(long pageAddr,
                                 long pageId)

Parameters:
  `pageAddr` - Page address.
  `pageId` - Root page ID.

#### setLastSuccessfulSnapshotId

    @Deprecated
    public void setLastSuccessfulSnapshotId​(long pageAddr,
                                            long lastSuccessfulSnapshotId)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.
  `lastSuccessfulSnapshotId` - Last successful snapshot id.

#### getLastSuccessfulSnapshotId

    @Deprecated
    public long getLastSuccessfulSnapshotId​(long pageAddr)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.

#### setLastSuccessfulFullSnapshotId

    @Deprecated
    public void setLastSuccessfulFullSnapshotId​(long pageAddr,
                                                long lastSuccessfulFullSnapshotId)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.
  `lastSuccessfulFullSnapshotId` - Last successful full snapshot id.

#### getLastSuccessfulFullSnapshotId

    @Deprecated
    public long getLastSuccessfulFullSnapshotId​(long pageAddr)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.

#### setNextSnapshotTag

    @Deprecated
    public void setNextSnapshotTag​(long pageAddr,
                                   long nextSnapshotTag)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.
  `nextSnapshotTag` - Next snapshot tag.

#### getLastSuccessfulSnapshotTag

    @Deprecated
    public long getLastSuccessfulSnapshotTag​(long pageAddr)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.

#### setLastSuccessfulSnapshotTag

    @Deprecated
    public void setLastSuccessfulSnapshotTag​(long pageAddr,
                                             long lastSuccessfulSnapshotTag)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.
  `lastSuccessfulSnapshotTag` - Last successful snapshot tag.

#### getNextSnapshotTag

    @Deprecated
    public long getNextSnapshotTag​(long pageAddr)

Deprecated.
Will be removed at 3.0. See IGNITE-11139.

Parameters:
  `pageAddr` - Page address.

#### setLastAllocatedPageCount

    public void setLastAllocatedPageCount​(long pageAddr,
                                          int pageCnt)

Sets last allocated pages count, used to save and observe previous allocated count

Parameters:
  `pageAddr` - Meta Page address.
  `pageCnt` - Last allocated pages count to set

#### getLastAllocatedPageCount

    public int getLastAllocatedPageCount​(@NotNull
                                         @NotNull ByteBuffer buf)

Gets last allocated pages count from given buffer

Parameters:
  `buf` - Buffer to read data from.

#### getLastAllocatedPageCount

    public int getLastAllocatedPageCount​(long pageAddr)

Gets last allocated pages count by provided address

Parameters:
  `pageAddr` - Meta page address.
Returns:
  Last allocated page count

#### setCandidatePageCount

    public boolean setCandidatePageCount​(long pageAddr,
                                         int pageCnt)

Parameters:
  `pageAddr` - Page address.
  `pageCnt` - Last page count.

#### getCandidatePageCount

    public int getCandidatePageCount​(long pageAddr)

Parameters:
  `pageAddr` - Page address.

#### printPage

    protected void printPage​(long addr,
                             int pageSize,
                             GridStringBuilder sb)
                      throws IgniteCheckedException

Specified by:
  `printPage` in class `PageIO`
Parameters:
  `addr` - Address.
  `pageSize` - Page size.
  `sb` - Sb.
Throws:
  `IgniteCheckedException`

#### getFreeSpace

    public int getFreeSpace​(int pageSize,
                            long pageAddr)

Count of bytes that is currently free in this page and possibly can be used to place additional payload.

Specified by:
  `getFreeSpace` in class `PageIO`
Parameters:
  `pageSize` - Page size.
  `pageAddr` - Page address.
Returns:
  Free space.