org.apache.ignite.internal.processors.cache.persistence.pagemem

## Class SegmentedLruPageList

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.pagemem.SegmentedLruPageList

    public class SegmentedLruPageList
    extends Object

Pages Segmented-LRU (SLRU) list implementation.

See Also:
  `PageReplacementMode.SEGMENTED_LRU`

### Constructor Summary

Constructors
Constructor and Description
`SegmentedLruPageList(int totalPagesCnt, long memPtr)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addToTail(int pageIdx, boolean protectedPage)` Add page to the tail of protected or probationary LRU list.
`void` `moveToTail(int pageIdx)` Move page to the tail of protected LRU list.
`int` `poll()` Remove page from the head of LRU list.
`void` `remove(int pageIdx)` Remove page from LRU list by page index.
`static long` `requiredMemory(int pagesCnt)` Memory required to service `pagesCnt` pages.

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

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

### Constructor Detail

#### SegmentedLruPageList

    public SegmentedLruPageList(int totalPagesCnt,
                                long memPtr)

Parameters:
  `totalPagesCnt` - Total pages count.
  `memPtr` - Pointer to memory region.

### Method Detail

#### poll

    public int poll()

Remove page from the head of LRU list.

Returns:
  Page index or `-1` if list is empty.

#### remove

    public void remove(int pageIdx)

Remove page from LRU list by page index.

Parameters:
  `pageIdx` - Page index.

#### addToTail

    public void addToTail(int pageIdx,
                          boolean protectedPage)

Add page to the tail of protected or probationary LRU list.

Parameters:
  `pageIdx` - Page index.
  `protectedPage` - Protected page flag.

#### moveToTail

    public void moveToTail(int pageIdx)

Move page to the tail of protected LRU list.

Parameters:
  `pageIdx` - Page index.

#### requiredMemory

    public static long requiredMemory(int pagesCnt)

Memory required to service `pagesCnt` pages.

Parameters:
  `pagesCnt` - Pages count.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023