Package org.apache.sysds.runtime.ooc.cache

# Class OOCCacheManager

java.lang.Object
org.apache.sysds.runtime.ooc.cache.OOCCacheManager

public class OOCCacheManager extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`OOCCacheManager.CachedGroupCallback<T>`
`static class`
`OOCCacheManager.CachedQueueCallback<T>`
`static class`
`OOCCacheManager.CachedSubCallback<T>`

## Constructor Summary

Constructors
Constructor
Description
`OOCCacheManager()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`canClaimMemory()`
`static void`
`forget(long streamId, int blockId)`
Removes a block from the cache without setting its data to null.
`static void`
`forget(BlockKey key)`
`static OOCCacheScheduler`
`getCache()`
`static OOCCacheScheduler`
`getCacheIfInitialized()`
Returns the current cache scheduler if already initialized, otherwise null.
`static OOCIOHandler`
`getIOHandler()`
`static OOCCacheScheduler.HandoverHandle`
`handover(BlockKey key, InMemoryQueueCallback callback)`
`static void`
`prioritize(BlockKey key, int priority)`
`static void`
`put(long streamId, int blockId, IndexedMatrixValue value)`
Store a block in the OOC cache (serialize once)
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`putAndPin(long streamId, int blockId, IndexedMatrixValue value)`
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`putAndPinRaw(BlockKey key, Object data, long size)`
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`putAndPinRawSourceBacked(BlockKey key, Object data, long size, OOCIOHandler.SourceBlockDescriptor descriptor)`
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`putAndPinSourceBacked(long streamId, int blockId, IndexedMatrixValue value, OOCIOHandler.SourceBlockDescriptor descriptor)`
`static void`
`putRaw(BlockKey key, Object data, long size)`
`static void`
`putRawSourceBacked(BlockKey key, Object data, long size, OOCIOHandler.SourceBlockDescriptor descriptor)`
`static void`
`putSourceBacked(long streamId, int blockId, IndexedMatrixValue value, OOCIOHandler.SourceBlockDescriptor descriptor)`
Store a source-backed block in the OOC cache and register its source location.
`static CompletableFuture<List<OOCStream.QueueCallback<IndexedMatrixValue>>>`
`requestAnyOf(List<BlockKey> keys, int n, List<BlockKey> sel)`
`static CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>>`
`requestBlock(long streamId, long blockId)`
`static CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>>`
`requestBlock(BlockKey key)`
`static CompletableFuture<List<OOCStream.QueueCallback<IndexedMatrixValue>>>`
`requestManyBlocks(List<BlockKey> keys)`
`static void`
`reset()`
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`tryRequestBlock(long streamId, long blockId)`
`static OOCStream.QueueCallback<IndexedMatrixValue>`
`tryRequestBlock(BlockKey key)`
`static List<OOCStream.QueueCallback<IndexedMatrixValue>>`
`tryRequestManyBlocks(List<BlockKey> keys)`

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

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

## Constructor Details

### OOCCacheManager

public OOCCacheManager()

## Method Details

### reset

public static void reset()

### getCache

public static OOCCacheScheduler getCache()

### getCacheIfInitialized

public static OOCCacheScheduler getCacheIfInitialized()
Returns the current cache scheduler if already initialized, otherwise null. This method does not trigger lazy initialization.

### getIOHandler

public static OOCIOHandler getIOHandler()

### forget

public static void forget(long streamId, int blockId)
Removes a block from the cache without setting its data to null.

### forget

public static void forget(BlockKey key)

### put

public static void put(long streamId, int blockId, IndexedMatrixValue value)
Store a block in the OOC cache (serialize once)

### putSourceBacked

public static void putSourceBacked(long streamId, int blockId, IndexedMatrixValue value, OOCIOHandler.SourceBlockDescriptor descriptor)
Store a source-backed block in the OOC cache and register its source location.

### putRawSourceBacked

public static void putRawSourceBacked(BlockKey key, Object data, long size, OOCIOHandler.SourceBlockDescriptor descriptor)

### putAndPin

public static OOCStream.QueueCallback<IndexedMatrixValue> putAndPin(long streamId, int blockId, IndexedMatrixValue value)

### putRaw

public static void putRaw(BlockKey key, Object data, long size)

### putAndPinRaw

public static OOCStream.QueueCallback<IndexedMatrixValue> putAndPinRaw(BlockKey key, Object data, long size)

### putAndPinSourceBacked

public static OOCStream.QueueCallback<IndexedMatrixValue> putAndPinSourceBacked(long streamId, int blockId, IndexedMatrixValue value, OOCIOHandler.SourceBlockDescriptor descriptor)

### putAndPinRawSourceBacked

public static OOCStream.QueueCallback<IndexedMatrixValue> putAndPinRawSourceBacked(BlockKey key, Object data, long size, OOCIOHandler.SourceBlockDescriptor descriptor)

### prioritize

public static void prioritize(BlockKey key, int priority)

### requestBlock

public static CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>> requestBlock(long streamId, long blockId)

### requestBlock

public static CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>> requestBlock(BlockKey key)

### tryRequestBlock

public static OOCStream.QueueCallback<IndexedMatrixValue> tryRequestBlock(long streamId, long blockId)

### tryRequestBlock

public static OOCStream.QueueCallback<IndexedMatrixValue> tryRequestBlock(BlockKey key)

### requestManyBlocks

public static CompletableFuture<List<OOCStream.QueueCallback<IndexedMatrixValue>>> requestManyBlocks(List<BlockKey> keys)

### tryRequestManyBlocks

public static List<OOCStream.QueueCallback<IndexedMatrixValue>> tryRequestManyBlocks(List<BlockKey> keys)

### requestAnyOf

public static CompletableFuture<List<OOCStream.QueueCallback<IndexedMatrixValue>>> requestAnyOf(List<BlockKey> keys, int n, List<BlockKey> sel)

### canClaimMemory

public static boolean canClaimMemory()

### handover

public static OOCCacheScheduler.HandoverHandle handover(BlockKey key, InMemoryQueueCallback callback)