Class BlockEntry
java.lang.Object
org.apache.sysds.runtime.ooc.cache.BlockEntry
-
Constructor Summary
ConstructorsConstructorDescriptionBlockEntry(BlockKey key) BlockEntry(BlockKey key, long size, Object data) BlockEntry(BlockKey key, long size, Object data, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionintvoidvoidaddRetainHint(int cnt) longclear()Tries to clear the underlying data if it is not pinnedbooleanfastPin()Tries to increment pin-count if already pinned.booleanTries to unpin but guarantees that it will not remove the last pin.intforget()getData()getKey()intintintlonggetSize()getState()booleanisPinned()intpin()Pins the underlying data in memoryvoidvoidsetCacheMeta(Object meta) voidsetDataUnsafe(Object data) voidsetState(BlockState state) toString()booleanunpin()Unpins the underlying data
-
Constructor Details
-
BlockEntry
-
BlockEntry
-
BlockEntry
-
-
Method Details
-
getKey
-
getSize
public long getSize() -
getData
-
getDataUnsafe
-
setDataUnsafe
-
getState
-
isPinned
public boolean isPinned() -
getPinCount
public int getPinCount() -
addReference
public int addReference() -
forget
public int forget() -
getReferenceCount
public int getReferenceCount() -
getCacheMeta
-
setCacheMeta
-
setState
-
addRetainHint
public void addRetainHint(int cnt) -
addRetainHint
public void addRetainHint() -
removeRetainHint
public void removeRetainHint() -
getRetainHintCount
public int getRetainHintCount() -
clear
public long clear()Tries to clear the underlying data if it is not pinned- Returns:
- the number of cleared bytes (or 0 if could not clear or data was already cleared)
-
pin
public int pin()Pins the underlying data in memory- Returns:
- the new number of pins (0 if pin was unsuccessful)
-
fastPin
public boolean fastPin()Tries to increment pin-count if already pinned. Unpinned entries are not affected by this operation. This allows bypassing the global cache lock. -
unpin
public boolean unpin()Unpins the underlying data- Returns:
- true if the data is now unpinned
-
fastUnpin
public boolean fastUnpin()Tries to unpin but guarantees that it will not remove the last pin. This allows bypassing the global cache lock. -
toString
-