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

## Class PageReplacementPolicy

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

Direct Known Subclasses:
  ClockPageReplacementPolicy, RandomLruPageReplacementPolicy, SegmentedLruPageReplacementPolicy

    public abstract class PageReplacementPolicy
    extends Object

Abstract page replacement policy.

### Field Summary

Fields
`protected org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment` `seg` Page memory segment.

### Constructor Summary

Constructors
`protected` `PageReplacementPolicy(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment seg)`

### Method Summary

All Methods Instance Methods Abstract 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.
`abstract long` `replace()` Finds page to replace.

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

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

### Field Detail

#### seg

    protected final org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment seg

Page memory segment.

### Constructor Detail

#### PageReplacementPolicy

    protected PageReplacementPolicy(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.Segment seg)

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.

#### onMiss

    public void onMiss(long relPtr)

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

#### onRemove

    public void onRemove(long relPtr)

Page removed from the page memory.

#### replace

    public abstract long replace()
                          throws IgniteCheckedException

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

Returns:
  Relative pointer to page.
Throws:
  `IgniteCheckedException`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022