Package org.apache.sysds.runtime.ooc.memory

# Class CachedAllowance

java.lang.Object
org.apache.sysds.runtime.ooc.memory.SyncMemoryAllowance
org.apache.sysds.runtime.ooc.memory.CachedAllowance

All Implemented Interfaces:
  `MemoryAllowance`

public class CachedAllowance extends SyncMemoryAllowance

## Constructor Summary

Constructors
Constructor
Description
`CachedAllowance(MemoryBroker broker)`

## Method Summary

Modifier and Type
Method
Description
`void`
`clear(int index)`
`CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>>`
`get(int index)`
`void`
`handover(InMemoryQueueCallback callback, int index)`
`void`
`reserveBlocking(long bytes)`
`void`
`setTargetMemory(long targetMemory)`
`OOCStream.QueueCallback<IndexedMatrixValue>`
`tryGet(int index)`
`boolean`
`tryReserve(long bytes)`

### Methods inherited from class org.apache.sysds.runtime.ooc.memory.SyncMemoryAllowance

`getGrantedMemory, getTargetMemory, getUsedMemory, isShutdown, release, reserveAsync, shutdown`

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

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

### Methods inherited from interface org.apache.sysds.runtime.ooc.memory.MemoryAllowance

`destroy, getFreeMemory, isUnderPressure`

## Constructor Details

### CachedAllowance

public CachedAllowance(MemoryBroker broker)

## Method Details

### handover

public void handover(InMemoryQueueCallback callback, int index)

### tryGet

public OOCStream.QueueCallback<IndexedMatrixValue> tryGet(int index)

### get

public CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>> get(int index)

### clear

public void clear(int index)

### tryReserve

public boolean tryReserve(long bytes)

Specified by:
  `tryReserve` in interface `MemoryAllowance`
Overrides:
  `tryReserve` in class `SyncMemoryAllowance`

### reserveBlocking

public void reserveBlocking(long bytes)

Specified by:
  `reserveBlocking` in interface `MemoryAllowance`
Overrides:
  `reserveBlocking` in class `SyncMemoryAllowance`

### setTargetMemory

public void setTargetMemory(long targetMemory)

Specified by:
  `setTargetMemory` in interface `MemoryAllowance`
Overrides:
  `setTargetMemory` in class `SyncMemoryAllowance`