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

## Class SegmentedLruPageReplacementPolicy

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

    public class SegmentedLruPageReplacementPolicy
    extends PageReplacementPolicy

Segmented-LRU page replacement policy implementation.

See Also:
  `PageReplacementMode.SEGMENTED_LRU`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.pagemem.PageReplacementPolicy

`seg`

### Constructor Summary

Constructors
`protected` `SegmentedLruPageReplacementPolicy(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment seg, long ptr, int pagesCnt)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `onHit(long relPtr)` Existing page touched.
`void` `onMiss(long relPtr)` New page added.
`void` `onRemove(long relPtr)` Page removed from the page memory.
`long` `replace()` Finds page to replace.

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

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

### Constructor Detail

#### SegmentedLruPageReplacementPolicy

    protected SegmentedLruPageReplacementPolicy(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment seg,
                                                long ptr,
                                                int pagesCnt)

Parameters:
  `seg` - Page memory segment.

### Method Detail

#### onHit

    public void onHit(long relPtr)

Existing page touched. Note: This method can be invoked under segment write lock or segment read lock.

Overrides:
  `onHit` in class `PageReplacementPolicy`

#### onMiss

    public void onMiss(long relPtr)

New page added. Note: This method always invoked under segment write lock.

Overrides:
  `onMiss` in class `PageReplacementPolicy`

#### onRemove

    public void onRemove(long relPtr)

Page removed from the page memory.

Overrides:
  `onRemove` in class `PageReplacementPolicy`

#### replace

    public long replace()
                 throws IgniteCheckedException

Finds page to replace. Note: This method always invoked under segment write lock.

Specified by:
  `replace` in class `PageReplacementPolicy`
Returns:
  Relative pointer to page.
Throws:
  `IgniteCheckedException`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021