Class ByteOutputContext
- java.lang.Object
-
- org.apache.nemo.runtime.executor.transfer.ByteTransferContext
-
- org.apache.nemo.runtime.executor.transfer.ByteOutputContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,OutputContext
public class ByteOutputContext extends ByteTransferContext implements OutputContext
Container for multiple output streams. Represents a transfer context on sender-side.Public methods are thread safe, although the execution order may not be linearized if they were called from different threads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ByteOutputContext.ByteOutputStream
AnOutputStream
implementation which buffers data toByteBuf
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this stream.ByteOutputContext.ByteOutputStream
newOutputStream()
Closes existing sub-stream (if any) and create a new sub-stream.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
-
newOutputStream
public final ByteOutputContext.ByteOutputStream newOutputStream() throws java.io.IOException
Closes existing sub-stream (if any) and create a new sub-stream.- Specified by:
newOutputStream
in interfaceOutputContext
- Returns:
- new
ByteOutputContext.ByteOutputStream
- Throws:
java.io.IOException
- if an exception was set or this context was closed.
-
close
public final void close() throws java.io.IOException
Closes this stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceOutputContext
- Throws:
java.io.IOException
- if an exception was set
-
onChannelError
public final 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
-
-