org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker

## Class PageLockTracker<T extends PageLockDump>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTracker<T>

All Implemented Interfaces:
  DumpSupported<T>, PageLockListener

Direct Known Subclasses:
  LockLog, LockStack

    public abstract class PageLockTracker<T extends PageLockDump>
    extends Object
    implements PageLockListener, DumpSupported<T>

Abstract page lock tracker.

### Field Summary

Fields
`static int` `BEFORE_READ_LOCK` Page read before lock operation id.
`static int` `BEFORE_WRITE_LOCK` Page write before lock operation id.
`protected int` `heldLockCnt` Counter for track lock/unlock operations.
`static int` `LOCK_IDX_MASK`
`static int` `LOCK_OP_MASK`
`protected String` `name`
`protected int` `nextOp`
`protected long` `nextOpPageId`
`protected int` `nextOpStructureId`
`static int` `OP_OFFSET`
`protected PageMetaInfoStore` `pages`
`static int` `READ_LOCK` Page read lock operation id.
`static int` `READ_UNLOCK` Page read unlock operation id.
`static int` `WRITE_LOCK` Page write lock operation id.
`static int` `WRITE_UNLOCK` Page write unlock operation id.

### Constructor Summary

Constructors
`protected` `PageLockTracker(String name, PageMetaInfoStore pages, PageLockTrackerManager.MemoryCalculator memCalc)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`boolean` `acquireSafePoint()`
`static String` `argsToString(int structureId, long pageId, int flags)`
`T` `dump()` Create dump.
`IgniteFuture<T>` `dumpSync()` Create dump async.
`protected void` `free()`
`int` `heldLocksNumber()`
`protected void` `invalid(String msg)`
`InvalidContext<T>` `invalidContext()`
`boolean` `isInvalid()`
`void` `onBeforeReadLock(int structureId, long pageId, long page)`
`void` `onBeforeReadLock0(int structureId, long pageId, long page)`
`void` `onBeforeWriteLock(int structureId, long pageId, long page)`
`void` `onBeforeWriteLock0(int structureId, long pageId, long page)`
`void` `onReadLock(int structureId, long pageId, long page, long pageAddr)`
`abstract void` `onReadLock0(int structureId, long pageId, long page, long pageAddr)`
`void` `onReadUnlock(int structureId, long pageId, long page, long pageAddr)`
`abstract void` `onReadUnlock0(int structureId, long pageId, long page, long pageAddr)`
`void` `onWriteLock(int structureId, long pageId, long page, long pageAddr)`
`abstract void` `onWriteLock0(int structureId, long pageId, long page, long pageAddr)`
`void` `onWriteUnlock(int structureId, long pageId, long page, long pageAddr)`
`abstract void` `onWriteUnlock0(int structureId, long pageId, long page, long pageAddr)`
`long` `operationsCounter()`
`static String` `pageIdToString(long pageId)`
`boolean` `releaseSafePoint()`
`protected abstract T` `snapshot()`
`protected boolean` `validateOperation(int structureId, long pageId, int op)`

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

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

### Field Detail

#### OP_OFFSET

    public static final int OP_OFFSET

See Also:
  Constant Field Values

#### LOCK_IDX_MASK

    public static final int LOCK_IDX_MASK

See Also:
  Constant Field Values

#### LOCK_OP_MASK

    public static final int LOCK_OP_MASK

See Also:
  Constant Field Values

#### READ_LOCK

    public static final int READ_LOCK

Page read lock operation id.

See Also:
  Constant Field Values

#### READ_UNLOCK

    public static final int READ_UNLOCK

Page read unlock operation id.

See Also:
  Constant Field Values

#### WRITE_LOCK

    public static final int WRITE_LOCK

Page write lock operation id.

See Also:
  Constant Field Values

#### WRITE_UNLOCK

    public static final int WRITE_UNLOCK

Page write unlock operation id.

See Also:
  Constant Field Values

#### BEFORE_READ_LOCK

    public static final int BEFORE_READ_LOCK

Page read before lock operation id.

See Also:
  Constant Field Values

#### BEFORE_WRITE_LOCK

    public static final int BEFORE_WRITE_LOCK

Page write before lock operation id.

See Also:
  Constant Field Values

#### name

    protected final String name

#### pages

    protected final PageMetaInfoStore pages

#### heldLockCnt

    protected int heldLockCnt

Counter for track lock/unlock operations.

#### nextOp

    protected int nextOp

#### nextOpStructureId

    protected int nextOpStructureId

#### nextOpPageId

    protected long nextOpPageId

### Constructor Detail

#### PageLockTracker

    protected PageLockTracker(String name,
                              PageMetaInfoStore pages,
                              PageLockTrackerManager.MemoryCalculator memCalc)

### Method Detail

#### onBeforeWriteLock0

    public void onBeforeWriteLock0(int structureId,
                                   long pageId,
                                   long page)

#### onBeforeReadLock0

    public void onBeforeReadLock0(int structureId,
                                  long pageId,
                                  long page)

#### onBeforeWriteLock

    public void onBeforeWriteLock(int structureId,
                                  long pageId,
                                  long page)

Specified by:
  `onBeforeWriteLock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.

#### onWriteLock

    public void onWriteLock(int structureId,
                            long pageId,
                            long page,
                            long pageAddr)

Specified by:
  `onWriteLock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.
  `pageAddr` - Page address.

#### onWriteUnlock

    public void onWriteUnlock(int structureId,
                              long pageId,
                              long page,
                              long pageAddr)

Specified by:
  `onWriteUnlock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.
  `pageAddr` - Page address.

#### onBeforeReadLock

    public void onBeforeReadLock(int structureId,
                                 long pageId,
                                 long page)

Specified by:
  `onBeforeReadLock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.

#### onReadLock

    public void onReadLock(int structureId,
                           long pageId,
                           long page,
                           long pageAddr)

Specified by:
  `onReadLock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.
  `pageAddr` - Page address.

#### onReadUnlock

    public void onReadUnlock(int structureId,
                             long pageId,
                             long page,
                             long pageAddr)

Specified by:
  `onReadUnlock` in interface `PageLockListener`
Parameters:
  `structureId` - Cache ID.
  `pageId` - Page ID.
  `page` - Page pointer.
  `pageAddr` - Page address.

#### onWriteLock0

    public abstract void onWriteLock0(int structureId,
                                      long pageId,
                                      long page,
                                      long pageAddr)

#### onWriteUnlock0

    public abstract void onWriteUnlock0(int structureId,
                                        long pageId,
                                        long page,
                                        long pageAddr)

#### onReadLock0

    public abstract void onReadLock0(int structureId,
                                     long pageId,
                                     long page,
                                     long pageAddr)

#### onReadUnlock0

    public abstract void onReadUnlock0(int structureId,
                                       long pageId,
                                       long page,
                                       long pageAddr)

#### isInvalid

    public boolean isInvalid()

#### invalidContext

    public InvalidContext<T> invalidContext()

#### free

    protected void free()

#### invalid

    protected void invalid(String msg)

#### operationsCounter

    public long operationsCounter()

Returns:
  Number of locks operations.

#### heldLocksNumber

    public int heldLocksNumber()

#### validateOperation

    protected boolean validateOperation(int structureId,
                                        long pageId,
                                        int op)

#### snapshot

    protected abstract T snapshot()

#### acquireSafePoint

    public boolean acquireSafePoint()

Specified by:
  `acquireSafePoint` in interface `DumpSupported<T extends PageLockDump>`

#### releaseSafePoint

    public boolean releaseSafePoint()

Specified by:
  `releaseSafePoint` in interface `DumpSupported<T extends PageLockDump>`

#### dump

    public T dump()

Create dump.

Specified by:
  `dump` in interface `DumpSupported<T extends PageLockDump>`

#### dumpSync

    public IgniteFuture<T> dumpSync()

Create dump async.

Specified by:
  `dumpSync` in interface `DumpSupported<T extends PageLockDump>`
Returns:
  Ignite future.

#### argsToString

    public static String argsToString(int structureId,
                                      long pageId,
                                      int flags)

#### pageIdToString

    public static String pageIdToString(long pageId)

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020