Class SubscribableTaskQueue<T>
java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.LocalTaskQueue<OOCStream.QueueCallback<T>>
org.apache.sysds.runtime.instructions.ooc.SubscribableTaskQueue<T>
- All Implemented Interfaces:
OOCStream<T>,OOCStreamable<T>
- Direct Known Subclasses:
SourceOOCStream
public class SubscribableTaskQueue<T>
extends LocalTaskQueue<OOCStream.QueueCallback<T>>
implements OOCStream<T>
-
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> -
Field Summary
Fields inherited from class org.apache.sysds.runtime.controlprogram.parfor.LocalTaskQueue
MAX_SIZE, NO_MORE_TASKS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidSynchronized (logical) insert of a NO_MORE_TASKS symbol at the end of the FIFO queue in order to mark that no more tasks will be inserted into the queue.dequeue()Synchronized read and delete from the top of the FIFO queue.voidvoidvoidSynchronized insert of a new task to the end of the FIFO queue.getData()booleanvoidvoidvoidvoidsetData(CacheableData<?> data) voidvoidsetIXTransform(BiFunction<Boolean, IndexRange, IndexRange> transform) voidsetSubscriber(Consumer<OOCStream.QueueCallback<T>> subscriber) Registers a new subscriber that consumes the stream.voidtoString()Methods inherited from class org.apache.sysds.runtime.controlprogram.parfor.LocalTaskQueue
hasNext, isProcessedMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sysds.runtime.instructions.ooc.OOCStreamable
isProcessed
-
Constructor Details
-
SubscribableTaskQueue
public SubscribableTaskQueue()
-
-
Method Details
-
enqueue
-
enqueue
-
enqueueTask
Description copied from class:LocalTaskQueueSynchronized insert of a new task to the end of the FIFO queue.- Overrides:
enqueueTaskin classLocalTaskQueue<OOCStream.QueueCallback<T>>- Parameters:
t- task
-
dequeue
-
dequeueCB
-
dequeueTask
Description copied from class:LocalTaskQueueSynchronized read and delete from the top of the FIFO queue.- Overrides:
dequeueTaskin classLocalTaskQueue<OOCStream.QueueCallback<T>>- Returns:
- task
-
closeInput
public void closeInput()Description copied from class:LocalTaskQueueSynchronized (logical) insert of a NO_MORE_TASKS symbol at the end of the FIFO queue in order to mark that no more tasks will be inserted into the queue.- Specified by:
closeInputin interfaceOOCStream<T>- Overrides:
closeInputin classLocalTaskQueue<OOCStream.QueueCallback<T>>
-
setSubscriber
Description copied from interface:OOCStreamRegisters 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:
setSubscriberin interfaceOOCStream<T>
-
propagateFailure
- Specified by:
propagateFailurein interfaceOOCStream<T>- Overrides:
propagateFailurein classLocalTaskQueue<OOCStream.QueueCallback<T>>
-
getReadStream
- Specified by:
getReadStreamin interfaceOOCStreamable<T>
-
getWriteStream
- Specified by:
getWriteStreamin interfaceOOCStreamable<T>
-
messageUpstream
- Specified by:
messageUpstreamin interfaceOOCStreamable<T>
-
messageDownstream
- Specified by:
messageDownstreamin interfaceOOCStreamable<T>
-
hasStreamCache
public boolean hasStreamCache()- Specified by:
hasStreamCachein interfaceOOCStreamable<T>
-
getStreamCache
- Specified by:
getStreamCachein interfaceOOCStreamable<T>
-
getDataCharacteristics
- Specified by:
getDataCharacteristicsin interfaceOOCStreamable<T>
-
getData
- Specified by:
getDatain interfaceOOCStreamable<T>
-
setData
- Specified by:
setDatain interfaceOOCStreamable<T>
-
setUpstreamMessageRelay
- Specified by:
setUpstreamMessageRelayin interfaceOOCStreamable<T>
-
setDownstreamMessageRelay
- Specified by:
setDownstreamMessageRelayin interfaceOOCStreamable<T>
-
addUpstreamMessageRelay
- Specified by:
addUpstreamMessageRelayin interfaceOOCStreamable<T>
-
addDownstreamMessageRelay
- Specified by:
addDownstreamMessageRelayin interfaceOOCStreamable<T>
-
clearUpstreamMessageRelays
public void clearUpstreamMessageRelays()- Specified by:
clearUpstreamMessageRelaysin interfaceOOCStreamable<T>
-
clearDownstreamMessageRelays
public void clearDownstreamMessageRelays()- Specified by:
clearDownstreamMessageRelaysin interfaceOOCStreamable<T>
-
setIXTransform
- Specified by:
setIXTransformin interfaceOOCStreamable<T>
-
toString
- Overrides:
toStringin classLocalTaskQueue<OOCStream.QueueCallback<T>>
-