Class PageLockTracker<T extends PageLockDump>
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTracker<T>
-
- All Implemented Interfaces:
AutoCloseable,DumpSupported<T>,PageLockListener
public abstract class PageLockTracker<T extends PageLockDump> extends Object implements PageLockListener, DumpSupported<T>
Abstract page lock tracker.
-
-
Field Summary
Fields Modifier and Type Field Description static intBEFORE_READ_LOCKPage read before lock operation id.static intBEFORE_WRITE_LOCKPage write before lock operation id.protected intheldLockCntCounter for track lock/unlock operations.static intLOCK_IDX_MASKstatic intLOCK_OP_MASKprotected Stringnameprotected intnextOpprotected longnextOpPageIdprotected intnextOpStructureIdstatic intOP_OFFSETprotected PageMetaInfoStorepagesstatic intREAD_LOCKPage read lock operation id.static intREAD_UNLOCKPage read unlock operation id.static intWRITE_LOCKPage write lock operation id.static intWRITE_UNLOCKPage write unlock operation id.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPageLockTracker(String name, PageMetaInfoStore pages, MemoryCalculator memCalc)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanacquireSafePoint()static StringargsToString(int structureId, long pageId, int flags)voidclose()Tdump()Create dump.intheldLocksNumber()protected voidinvalid(String msg)InvalidContext<T>invalidContext()booleanisInvalid()voidonBeforeReadLock(int structureId, long pageId, long page)voidonBeforeReadLock0(int structureId, long pageId, long page)voidonBeforeWriteLock(int structureId, long pageId, long page)voidonBeforeWriteLock0(int structureId, long pageId, long page)voidonReadLock(int structureId, long pageId, long page, long pageAddr)abstract voidonReadLock0(int structureId, long pageId, long page, long pageAddr)voidonReadUnlock(int structureId, long pageId, long page, long pageAddr)abstract voidonReadUnlock0(int structureId, long pageId, long page, long pageAddr)voidonWriteLock(int structureId, long pageId, long page, long pageAddr)abstract voidonWriteLock0(int structureId, long pageId, long page, long pageAddr)voidonWriteUnlock(int structureId, long pageId, long page, long pageAddr)abstract voidonWriteUnlock0(int structureId, long pageId, long page, long pageAddr)longoperationsCounter()static StringpageIdToString(long pageId)booleanreleaseSafePoint()protected abstract Tsnapshot()protected booleanvalidateOperation(int structureId, long pageId, int op)
-
-
-
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, 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:
onBeforeWriteLockin interfacePageLockListener- Parameters:
structureId- Cache ID.pageId- Page ID.page- Page pointer.
-
onWriteLock
public void onWriteLock(int structureId, long pageId, long page, long pageAddr)- Specified by:
onWriteLockin interfacePageLockListener- 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:
onWriteUnlockin interfacePageLockListener- 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:
onBeforeReadLockin interfacePageLockListener- Parameters:
structureId- Cache ID.pageId- Page ID.page- Page pointer.
-
onReadLock
public void onReadLock(int structureId, long pageId, long page, long pageAddr)- Specified by:
onReadLockin interfacePageLockListener- 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:
onReadUnlockin interfacePageLockListener- 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()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePageLockListener
-
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:
acquireSafePointin interfaceDumpSupported<T extends PageLockDump>
-
releaseSafePoint
public boolean releaseSafePoint()
- Specified by:
releaseSafePointin interfaceDumpSupported<T extends PageLockDump>
-
dump
public T dump()
Create dump.- Specified by:
dumpin interfaceDumpSupported<T extends PageLockDump>
-
argsToString
public static String argsToString(int structureId, long pageId, int flags)
-
pageIdToString
public static String pageIdToString(long pageId)
-
-