Package org.apache.wayang.java.channels
Class StreamChannel.Instance
- java.lang.Object
-
- org.apache.wayang.core.util.AbstractReferenceCountable
-
- org.apache.wayang.core.platform.ExecutionResourceTemplate
-
- org.apache.wayang.core.platform.AbstractChannelInstance
-
- org.apache.wayang.java.channels.StreamChannel.Instance
-
- All Implemented Interfaces:
ChannelInstance,ExecutionResource,ReferenceCountable,JavaChannelInstance
- Enclosing class:
- StreamChannel
public class StreamChannel.Instance extends AbstractChannelInstance implements JavaChannelInstance
JavaChannelInstanceimplementation forStreamChannels.
-
-
Constructor Summary
Constructors Constructor Description Instance(Executor executor, OptimizationContext.OperatorContext producerOperatorContext, int producerOutputIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(java.util.Collection<?> collection)<T> voidaccept(java.util.stream.Stream<T> stream)protected voiddoDispose()Performs the actual disposing work of this instance.ChannelgetChannel()java.util.OptionalLonggetMeasuredCardinality()Optionally provides the measured cardinality of this instance.<T> java.util.stream.Stream<T>provideStream()Provide the producer's result to a consumer.-
Methods inherited from class org.apache.wayang.core.platform.AbstractChannelInstance
getLineage, getProducerOperatorContext, markProduced, setMeasuredCardinality, toString, wasProduced
-
Methods inherited from class org.apache.wayang.core.platform.ExecutionResourceTemplate
dispose, disposeUnreferenced
-
Methods inherited from class org.apache.wayang.core.util.AbstractReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wayang.core.platform.ChannelInstance
getLineage, getProducerOperatorContext, isMarkedForInstrumentation, markProduced, setMeasuredCardinality, wasProduced
-
Methods inherited from interface org.apache.wayang.core.platform.ExecutionResource
dispose
-
Methods inherited from interface org.apache.wayang.core.util.ReferenceCountable
disposeIfUnreferenced, getNumReferences, isDisposed, noteDiscardedReference, noteObtainedReference
-
-
-
-
Constructor Detail
-
Instance
public Instance(Executor executor, OptimizationContext.OperatorContext producerOperatorContext, int producerOutputIndex)
-
-
Method Detail
-
accept
public <T> void accept(java.util.stream.Stream<T> stream)
-
accept
public void accept(java.util.Collection<?> collection)
-
provideStream
public <T> java.util.stream.Stream<T> provideStream()
Description copied from interface:JavaChannelInstanceProvide the producer's result to a consumer.- Specified by:
provideStreamin interfaceJavaChannelInstance- Returns:
- the producer's result
-
getChannel
public Channel getChannel()
- Specified by:
getChannelin interfaceChannelInstance- Returns:
- the
Channelthat is implemented by this instance
-
getMeasuredCardinality
public java.util.OptionalLong getMeasuredCardinality()
Description copied from interface:ChannelInstanceOptionally provides the measured cardinality of this instance. However, such a cardinality might not be available for several reasons. For instance, the measurement might not have been requested or could not be implemented by the executingPlatform.- Specified by:
getMeasuredCardinalityin interfaceChannelInstance- Overrides:
getMeasuredCardinalityin classAbstractChannelInstance- Returns:
- the measured cardinality if available
-
doDispose
protected void doDispose() throws WayangExceptionDescription copied from class:ExecutionResourceTemplatePerforms the actual disposing work of this instance.- Specified by:
doDisposein classExecutionResourceTemplate- Throws:
WayangException
-
-