Class OOCPackedCache
java.lang.Object
org.apache.sysds.runtime.ooc.cache.packed.OOCPackedCache
- All Implemented Interfaces:
OOCCache
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classNested classes/interfaces inherited from interface org.apache.sysds.runtime.ooc.cache.OOCCache
OOCCache.UnpinHandle -
Constructor Summary
ConstructorsConstructorDescriptionOOCPackedCache(OOCIOHandler ioHandler, long hardLimit, long evictionLimit) OOCPackedCache(OOCCacheImpl physical) OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long sealDelayMs) OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long maxStagingBytes, int maxOpenBuilders, long sealDelayMs, long packReleaseDelayMs) OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long sealDelayMs, long packReleaseDelayMs) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEvictionPolicy(long streamId, LongUnaryOperator scoreFn) Adds an eviction scoring policy for one logical cache stream.intdereference(BlockEntry entry) Dereferencing allows an entry to be forgotten if no further reference is held.intdereference(BlockKey key) Dereferencing allows an entry to be forgotten if no further reference is held.voidlongReturns the current cache-owned size in bytes.getPackGroup(long sId, long tId) intpin(long sId, long tId, MemoryAllowance allowance) Pins an item backed by an allowance.pinAdmitted(long sId, long tId, MemoryAllowance allowance) Pins an item backed by an allowance.pinIfLive(long sId, long tId, MemoryAllowance allowance) Pins an item backed by an allowance if it is already live in cache.pinPack(OOCPackedCache.PackGroup group, MemoryAllowance allowance) putPackPinned(long sId, long[] tIds, Object[] data, long[] sizes, int off, int len, MemoryAllowance allowance) putPinned(long sId, long tId, Object data, long size, MemoryAllowance allowance) Adds a new pinned entry whose bytes are already owned by the given allowance.putSealedPackPinned(long sId, long[] tIds, Object[] data, long[] sizes, int off, int len, MemoryAllowance allowance) intreference(BlockEntry entry) Referencing a pinned entry guarantees that its key remains in the cache until dereferenced.voidshutdown()unpin(BlockEntry entry, MemoryAllowance allowance) Unpins an item that is still backed by the given allowance.voidupdateLimits(long hardLimit, long evictionLimit) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sysds.runtime.ooc.cache.OOCCache
pin, pinAdmitted, putPinned
-
Constructor Details
-
OOCPackedCache
-
OOCPackedCache
-
OOCPackedCache
public OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long sealDelayMs) -
OOCPackedCache
public OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long sealDelayMs, long packReleaseDelayMs) -
OOCPackedCache
public OOCPackedCache(OOCCacheImpl physical, long packThresholdBytes, long packTargetBytes, long maxStagingBytes, int maxOpenBuilders, long sealDelayMs, long packReleaseDelayMs)
-
-
Method Details
-
putPinned
Description copied from interface:OOCCacheAdds a new pinned entry whose bytes are already owned by the given allowance. Ownership can later move only via pin/unpin. -
putPackPinned
public BlockEntry[] putPackPinned(long sId, long[] tIds, Object[] data, long[] sizes, int off, int len, MemoryAllowance allowance) -
putSealedPackPinned
public BlockEntry putSealedPackPinned(long sId, long[] tIds, Object[] data, long[] sizes, int off, int len, MemoryAllowance allowance) -
getPackGroup
-
getPackGroupCount
public int getPackGroupCount() -
pinPack
public OOCFuture<OOCPackedCache.PackLease> pinPack(OOCPackedCache.PackGroup group, MemoryAllowance allowance) -
pin
Description copied from interface:OOCCachePins an item backed by an allowance. A successful pin transfers memory ownership from the cache to the owner of the allowance and guarantees data availability. While pinned, the bytes of the entry are not counted as cache-owned memory. -
pinAdmitted
Description copied from interface:OOCCachePins an item backed by an allowance. If the allowance cannot reserve enough memory, this method will wait until memory is available. A successful pin transfers memory ownership from the cache to the owner of the allowance and guarantees data availability. While pinned, the bytes of the entry are not counted as cache-owned memory.- Specified by:
pinAdmittedin interfaceOOCCache- Returns:
- a non-null future of the pinned block entry
-
pinIfLive
Description copied from interface:OOCCachePins an item backed by an allowance if it is already live in cache. A successful pin transfers memory ownership from the cache to the owner of the allowance and guarantees data availability. While pinned, the bytes of the entry are not counted as cache-owned memory. Implementations must reserve the required bytes from the allowance before making data available. -
unpin
Description copied from interface:OOCCacheUnpins an item that is still backed by the given allowance. Unpinning tries to transfer memory ownership back to the cache. An ownership transfer may commit immediately only if this does not cause the cache to exceed its hard limit. Otherwise, the transfer is deferred and the allowance remains charged until the returned handle commits, is reclaimed, or is superseded by a later pin that transfers ownership to another allowance. Unpin can be viewed as an eventually resolving operation. -
reference
Description copied from interface:OOCCacheReferencing a pinned entry guarantees that its key remains in the cache until dereferenced. -
dereference
Description copied from interface:OOCCacheDereferencing allows an entry to be forgotten if no further reference is held. Dereferencing may not immediately cause entry removal if still pinned.- Specified by:
dereferencein interfaceOOCCache- Returns:
-
dereference
Description copied from interface:OOCCacheDereferencing allows an entry to be forgotten if no further reference is held. Dereferencing may not immediately cause entry removal if still pinned.- Specified by:
dereferencein interfaceOOCCache
-
updateLimits
public void updateLimits(long hardLimit, long evictionLimit) - Specified by:
updateLimitsin interfaceOOCCache
-
addEvictionPolicy
Description copied from interface:OOCCacheAdds an eviction scoring policy for one logical cache stream. Larger scores are selected for eviction first.Long.MAX_VALUEremains reserved as "no policy score".- Specified by:
addEvictionPolicyin interfaceOOCCache
-
getOwnedCacheSize
public long getOwnedCacheSize()Description copied from interface:OOCCacheReturns the current cache-owned size in bytes.- Specified by:
getOwnedCacheSizein interfaceOOCCache
-
shutdown
public void shutdown() -
flushPacks
public void flushPacks()
-