Class ByteInputContext
- java.lang.Object
-
- org.apache.nemo.runtime.executor.transfer.ByteTransferContext
-
- org.apache.nemo.runtime.executor.transfer.ByteInputContext
-
public final class ByteInputContext extends ByteTransferContext
Container for multiple input streams. Represents a transfer context on receiver-side.Thread safety:
Methods with default access modifier, namely
onNewStream()
,onByteBuf(ByteBuf)
,onContextClose()
, are not thread-safe, since they are called by a single Netty event loop.Public methods are thread safe, although the execution order may not be linearized if they were called from different threads.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.Iterator<java.io.InputStream>>
getCompletedFuture()
Returns a future, which is completed when the corresponding transfer for this context gets done.java.util.Iterator<java.io.InputStream>
getInputStreams()
ReturnsIterator
ofInputStream
s.void
onChannelError(java.lang.Throwable cause)
Handles exception.-
Methods inherited from class org.apache.nemo.runtime.executor.transfer.ByteTransferContext
deregister, getContextDescriptor, getContextId, getException, getRemoteExecutorId, hasException, setChannelError, toString
-
-
-
-
Method Detail
-
getInputStreams
public java.util.Iterator<java.io.InputStream> getInputStreams()
ReturnsIterator
ofInputStream
s. This method always returns the sameIterator
instance.- Returns:
Iterator
ofInputStream
s.
-
getCompletedFuture
public java.util.concurrent.CompletableFuture<java.util.Iterator<java.io.InputStream>> getCompletedFuture()
Returns a future, which is completed when the corresponding transfer for this context gets done.- Returns:
- a
CompletableFuture
for the same value thatgetInputStreams()
returns
-
onChannelError
public void onChannelError(@Nullable java.lang.Throwable cause)
Description copied from class:ByteTransferContext
Handles exception.- Specified by:
onChannelError
in classByteTransferContext
- Parameters:
cause
- the cause of exception handling
-
-