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

# Class InMemoryQueueCallback

java.lang.Object
org.apache.sysds.runtime.ooc.memory.InMemoryQueueCallback

All Implemented Interfaces:
  `AutoCloseable`, `OOCStream.QueueCallback<IndexedMatrixValue>`

public class InMemoryQueueCallback extends Object implements OOCStream.QueueCallback<IndexedMatrixValue>

## Constructor Summary

Constructors
Constructor
Description
`InMemoryQueueCallback(IndexedMatrixValue result, DMLRuntimeException failure, MemoryAllowance allow, long reservedBytes)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`fail(DMLRuntimeException failure)`
`IndexedMatrixValue`
`get()`
`long`
`getManagedBytes()`
`boolean`
`isEos()`
`boolean`
`isFailure()`
`OOCStream.QueueCallback<IndexedMatrixValue>`
`keepOpen()`
Keeps the callback item pinned in memory until the returned callback is also closed.
`long`
`releaseManagedMemory()`
`IndexedMatrixValue`
`takeManagedResultForHandover()`
`void`
`transferOwnershipBlocking(MemoryAllowance allowance)`
`boolean`
`tryTransferOwnership(MemoryAllowance allowance)`

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

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

## Constructor Details

### InMemoryQueueCallback

public InMemoryQueueCallback(IndexedMatrixValue result, DMLRuntimeException failure, MemoryAllowance allow, long reservedBytes)

## Method Details

### get

public IndexedMatrixValue get()

Specified by:
  `get` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### keepOpen

public OOCStream.QueueCallback<IndexedMatrixValue> keepOpen()
Description copied from interface: `OOCStream.QueueCallback`
Keeps the callback item pinned in memory until the returned callback is also closed.

Specified by:
  `keepOpen` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### fail

public void fail(DMLRuntimeException failure)

Specified by:
  `fail` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### getManagedBytes

public long getManagedBytes()

### tryTransferOwnership

public boolean tryTransferOwnership(MemoryAllowance allowance)

### transferOwnershipBlocking

public void transferOwnershipBlocking(MemoryAllowance allowance)

### releaseManagedMemory

public long releaseManagedMemory()

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### isEos

public boolean isEos()

Specified by:
  `isEos` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### isFailure

public boolean isFailure()

Specified by:
  `isFailure` in interface `OOCStream.QueueCallback<IndexedMatrixValue>`

### takeManagedResultForHandover

public IndexedMatrixValue takeManagedResultForHandover()