Class CachingStream
java.lang.Object
org.apache.sysds.runtime.instructions.ooc.CachingStream
- All Implemented Interfaces:
OOCStreamable<IndexedMatrixValue>
A wrapper around LocalTaskQueue to consume the source stream and reset to
consume again for other operators.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCachingStream(OOCStream<IndexedMatrixValue> source) CachingStream(OOCStream<IndexedMatrixValue> source, long streamId) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidfindCached(MatrixIndexes idx) voidfindCachedAsync(MatrixIndexes idx, Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> callback) intget(int idx) getData()booleanvoidincrProcessingCount(int i, int count) Artificially increase the processing count of a block.voidincrProcessingCount(MatrixIndexes idx, int count) voidincrSubscriberCount(int count) Artificially increase subscriber count.booleanvoidvoidpeekCached(MatrixIndexes idx) Finds a cached item without counting it as a consumption.voidpeekCachedAsync(MatrixIndexes idx, Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> callback) Finds a cached item asynchronously without counting it as a consumption.voidvoidsetData(CacheableData<?> data) voidvoidsetIXTransform(BiFunction<Boolean, IndexRange, IndexRange> transform) voidsetSubscriber(Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> subscriber, boolean incrConsumers) voidtoString()
-
Field Details
-
_streamSeq
-
-
Constructor Details
-
CachingStream
-
CachingStream
-
-
Method Details
-
scheduleDeletion
public void scheduleDeletion() -
toString
-
get
public CompletableFuture<OOCStream.QueueCallback<IndexedMatrixValue>> get(int idx) throws InterruptedException, ExecutionException -
findCachedIndex
-
peekCachedBlockKey
-
findCached
-
findCachedAsync
public void findCachedAsync(MatrixIndexes idx, Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> callback) -
peekCachedAsync
public void peekCachedAsync(MatrixIndexes idx, Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> callback) Finds a cached item asynchronously without counting it as a consumption. -
peekCached
Finds a cached item without counting it as a consumption. -
activateIndexing
public void activateIndexing() -
getReadStream
- Specified by:
getReadStreamin interfaceOOCStreamable<IndexedMatrixValue>
-
getWriteStream
- Specified by:
getWriteStreamin interfaceOOCStreamable<IndexedMatrixValue>
-
hasStreamCache
public boolean hasStreamCache()- Specified by:
hasStreamCachein interfaceOOCStreamable<IndexedMatrixValue>
-
getStreamCache
- Specified by:
getStreamCachein interfaceOOCStreamable<IndexedMatrixValue>
-
isProcessed
public boolean isProcessed()- Specified by:
isProcessedin interfaceOOCStreamable<IndexedMatrixValue>
-
getDataCharacteristics
- Specified by:
getDataCharacteristicsin interfaceOOCStreamable<IndexedMatrixValue>
-
getData
- Specified by:
getDatain interfaceOOCStreamable<IndexedMatrixValue>
-
setData
- Specified by:
setDatain interfaceOOCStreamable<IndexedMatrixValue>
-
messageUpstream
- Specified by:
messageUpstreamin interfaceOOCStreamable<IndexedMatrixValue>
-
messageDownstream
- Specified by:
messageDownstreamin interfaceOOCStreamable<IndexedMatrixValue>
-
setUpstreamMessageRelay
- Specified by:
setUpstreamMessageRelayin interfaceOOCStreamable<IndexedMatrixValue>
-
setDownstreamMessageRelay
- Specified by:
setDownstreamMessageRelayin interfaceOOCStreamable<IndexedMatrixValue>
-
addUpstreamMessageRelay
- Specified by:
addUpstreamMessageRelayin interfaceOOCStreamable<IndexedMatrixValue>
-
addDownstreamMessageRelay
- Specified by:
addDownstreamMessageRelayin interfaceOOCStreamable<IndexedMatrixValue>
-
clearUpstreamMessageRelays
public void clearUpstreamMessageRelays()- Specified by:
clearUpstreamMessageRelaysin interfaceOOCStreamable<IndexedMatrixValue>
-
clearDownstreamMessageRelays
public void clearDownstreamMessageRelays()- Specified by:
clearDownstreamMessageRelaysin interfaceOOCStreamable<IndexedMatrixValue>
-
setIXTransform
- Specified by:
setIXTransformin interfaceOOCStreamable<IndexedMatrixValue>
-
setSubscriber
public void setSubscriber(Consumer<OOCStream.QueueCallback<IndexedMatrixValue>> subscriber, boolean incrConsumers) -
incrSubscriberCount
public void incrSubscriberCount(int count) Artificially increase subscriber count. Only use if certain blocks are accessed more than once. -
incrProcessingCount
public void incrProcessingCount(int i, int count) Artificially increase the processing count of a block. -
incrProcessingCount
-