Package org.apache.sysds.runtime.instructions.ooc

# Class PlaybackStream

java.lang.Object
org.apache.sysds.runtime.instructions.ooc.PlaybackStream

All Implemented Interfaces:
  `OOCStream<IndexedMatrixValue>`, `OOCStreamable<IndexedMatrixValue>`

public class PlaybackStream extends Object implements OOCStream<IndexedMatrixValue>

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.apache.sysds.runtime.instructions.ooc.OOCStream

`OOCStream.GroupQueueCallback<T>, OOCStream.QueueCallback<T>, OOCStream.SimpleQueueCallback<T>`

## Constructor Summary

Constructors
Constructor
Description
`PlaybackStream(CachingStream streamCache)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addDownstreamMessageRelay(Consumer<OOCStreamMessage> relay)`
`void`
`addUpstreamMessageRelay(Consumer<OOCStreamMessage> relay)`
`void`
`clearDownstreamMessageRelays()`
`void`
`clearUpstreamMessageRelays()`
`void`
`closeInput()`
`IndexedMatrixValue`
`dequeue()`
`OOCStream.QueueCallback<IndexedMatrixValue>`
`dequeueCB()`
`void`
`enqueue(OOCStream.QueueCallback<IndexedMatrixValue> callback)`
`void`
`enqueue(IndexedMatrixValue t)`
`CacheableData<?>`
`getData()`
`DataCharacteristics`
`getDataCharacteristics()`
`OOCStream<IndexedMatrixValue>`
`getReadStream()`
`CachingStream`
`getStreamCache()`
`OOCStream<IndexedMatrixValue>`
`getWriteStream()`
`boolean`
`hasStreamCache()`
`boolean`
`isProcessed()`
`void`
`messageDownstream(OOCStreamMessage msg)`
`void`
`messageUpstream(OOCStreamMessage msg)`
`void`
`propagateFailure(DMLRuntimeException re)`
`void`
`setData(CacheableData<?> data)`
`void`
`setDownstreamMessageRelay(Consumer<OOCStreamMessage> relay)`
`void`
`setIXTransform(BiFunction<Boolean,IndexRange,IndexRange> transform)`
`void`
`setSubscriber(Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> subscriber)`
Registers a new subscriber that consumes the stream.
`void`
`setUpstreamMessageRelay(Consumer<OOCStreamMessage> relay)`

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

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

## Constructor Details

### PlaybackStream

public PlaybackStream(CachingStream streamCache)

## Method Details

### enqueue

public void enqueue(IndexedMatrixValue t)

Specified by:
  `enqueue` in interface `OOCStream<IndexedMatrixValue>`

### enqueue

public void enqueue(OOCStream.QueueCallback<IndexedMatrixValue> callback)

Specified by:
  `enqueue` in interface `OOCStream<IndexedMatrixValue>`

### closeInput

public void closeInput()

Specified by:
  `closeInput` in interface `OOCStream<IndexedMatrixValue>`

### dequeue

public IndexedMatrixValue dequeue()

Specified by:
  `dequeue` in interface `OOCStream<IndexedMatrixValue>`

### dequeueCB

public OOCStream.QueueCallback<IndexedMatrixValue> dequeueCB()

Specified by:
  `dequeueCB` in interface `OOCStream<IndexedMatrixValue>`

### getReadStream

public OOCStream<IndexedMatrixValue> getReadStream()

Specified by:
  `getReadStream` in interface `OOCStreamable<IndexedMatrixValue>`

### getWriteStream

public OOCStream<IndexedMatrixValue> getWriteStream()

Specified by:
  `getWriteStream` in interface `OOCStreamable<IndexedMatrixValue>`

### isProcessed

public boolean isProcessed()

Specified by:
  `isProcessed` in interface `OOCStreamable<IndexedMatrixValue>`

### getDataCharacteristics

public DataCharacteristics getDataCharacteristics()

Specified by:
  `getDataCharacteristics` in interface `OOCStreamable<IndexedMatrixValue>`

### getData

public CacheableData<?> getData()

Specified by:
  `getData` in interface `OOCStreamable<IndexedMatrixValue>`

### setData

public void setData(CacheableData<?> data)

Specified by:
  `setData` in interface `OOCStreamable<IndexedMatrixValue>`

### messageUpstream

public void messageUpstream(OOCStreamMessage msg)

Specified by:
  `messageUpstream` in interface `OOCStreamable<IndexedMatrixValue>`

### messageDownstream

public void messageDownstream(OOCStreamMessage msg)

Specified by:
  `messageDownstream` in interface `OOCStreamable<IndexedMatrixValue>`

### setSubscriber

public void setSubscriber(Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> subscriber)
Description copied from interface: `OOCStream`
Registers a new subscriber that consumes the stream. While there is no guarantee for any specific order, the closing item LocalTaskQueue.NO_MORE_TASKS is guaranteed to be invoked after every other item has finished processing. Thus, the NO_MORE_TASKS callback can be used to free dependent resources and close output streams.

Specified by:
  `setSubscriber` in interface `OOCStream<IndexedMatrixValue>`

### propagateFailure

public void propagateFailure(DMLRuntimeException re)

Specified by:
  `propagateFailure` in interface `OOCStream<IndexedMatrixValue>`

### hasStreamCache

public boolean hasStreamCache()

Specified by:
  `hasStreamCache` in interface `OOCStreamable<IndexedMatrixValue>`

### getStreamCache

public CachingStream getStreamCache()

Specified by:
  `getStreamCache` in interface `OOCStreamable<IndexedMatrixValue>`

### setUpstreamMessageRelay

public void setUpstreamMessageRelay(Consumer<OOCStreamMessage> relay)

Specified by:
  `setUpstreamMessageRelay` in interface `OOCStreamable<IndexedMatrixValue>`

### setDownstreamMessageRelay

public void setDownstreamMessageRelay(Consumer<OOCStreamMessage> relay)

Specified by:
  `setDownstreamMessageRelay` in interface `OOCStreamable<IndexedMatrixValue>`

### addUpstreamMessageRelay

public void addUpstreamMessageRelay(Consumer<OOCStreamMessage> relay)

Specified by:
  `addUpstreamMessageRelay` in interface `OOCStreamable<IndexedMatrixValue>`

### addDownstreamMessageRelay

public void addDownstreamMessageRelay(Consumer<OOCStreamMessage> relay)

Specified by:
  `addDownstreamMessageRelay` in interface `OOCStreamable<IndexedMatrixValue>`

### clearUpstreamMessageRelays

public void clearUpstreamMessageRelays()

Specified by:
  `clearUpstreamMessageRelays` in interface `OOCStreamable<IndexedMatrixValue>`

### clearDownstreamMessageRelays

public void clearDownstreamMessageRelays()

Specified by:
  `clearDownstreamMessageRelays` in interface `OOCStreamable<IndexedMatrixValue>`

### setIXTransform

public void setIXTransform(BiFunction<Boolean,IndexRange,IndexRange> transform)

Specified by:
  `setIXTransform` in interface `OOCStreamable<IndexedMatrixValue>`