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

## Class PagesListNodeIO

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

    public class PagesListNodeIO
    extends PageIO

TODO optimize: now we have slow `removePage(long, long)`

### Field Summary

Fields
`static IOVersions<PagesListNodeIO>` `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, 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_REF_INNER, T_DATA_REF_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_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
`protected` `PagesListNodeIO(int ver)`

### Method Summary

Methods
`int` `addPage(long pageAddr, long pageId, int pageSize)` Adds page to the end of pages list.
`int` `getCount(long pageAddr)` Gets total count of entries in this page.
`long` `getNextId(long pageAddr)`
`long` `getPreviousId(long pageAddr)`
`void` `initNewPage(long pageAddr, long pageId, int pageSize)`
`boolean` `isEmpty(long pageAddr)`
`boolean` `removePage(long pageAddr, long dataPageId)` Removes the given page ID from the pages list.
`void` `setNextId(long pageAddr, long nextId)`
`void` `setPreviousId(long pageAddr, long prevId)`
`long` `takeAnyPage(long pageAddr)` Removes any page from the pages list.

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

`getBPlusIO, getBPlusIO, getCrc, getCrc, getInnerVersions, getLeafVersions, getPageId, getPageId, getPageIO, getPageIO, getType, getType, getType, getVersion, getVersion, getVersion, isDataPageType, registerH2, registerH2ExtraInner, registerH2ExtraLeaf, registerTest, setCrc, setCrc, setPageId, setType, 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<PagesListNodeIO> VERSIONS

### Constructor Detail

#### PagesListNodeIO

    protected PagesListNodeIO(int ver)

Parameters:
  `ver` - Page format version.

### Method Detail

#### initNewPage

    public void initNewPage(long pageAddr,
                   long pageId,
                   int pageSize)

Overrides:
  `initNewPage` in class `PageIO`
Parameters:
  `pageAddr` - Page address.
  `pageId` - Page ID.
  `pageSize` - Page size.

#### getNextId

    public long getNextId(long pageAddr)

Parameters:
  `pageAddr` - Page address.
Returns:
  Next page ID.

#### setNextId

    public void setNextId(long pageAddr,
                 long nextId)

Parameters:
  `pageAddr` - Page address.
  `nextId` - Next page ID.

#### getPreviousId

    public long getPreviousId(long pageAddr)

Parameters:
  `pageAddr` - Page address.
Returns:
  Previous page ID.

#### setPreviousId

    public void setPreviousId(long pageAddr,
                     long prevId)

Parameters:
  `pageAddr` - Page address.
  `prevId` - Previous page ID.

#### getCount

    public int getCount(long pageAddr)

Gets total count of entries in this page. Does not change the buffer state.

Parameters:
  `pageAddr` - Page address to get count from.
Returns:
  Total number of entries.

#### addPage

    public int addPage(long pageAddr,
              long pageId,
              int pageSize)

Adds page to the end of pages list.

Parameters:
  `pageAddr` - Page address.
  `pageId` - Page ID.
  `pageSize` - Page size.
Returns:
  Total number of items in this page.

#### takeAnyPage

    public long takeAnyPage(long pageAddr)

Removes any page from the pages list.

Parameters:
  `pageAddr` - Page address.
Returns:
  Removed page ID.

#### removePage

    public boolean removePage(long pageAddr,
                     long dataPageId)

Removes the given page ID from the pages list.

Parameters:
  `pageAddr` - Page address.
  `dataPageId` - Page ID to remove.
Returns:
  `true` if page was in the list and was removed, `false` otherwise.

#### isEmpty

    public boolean isEmpty(long pageAddr)

Parameters:
  `pageAddr` - Page address.
Returns:
  `True` if there are no items in this page.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017