Class ByteOutputContext.ByteOutputStream
- java.lang.Object
-
- org.apache.nemo.runtime.executor.transfer.ByteOutputContext.ByteOutputStream
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,TransferOutputStream
- Enclosing class:
- ByteOutputContext
public final class ByteOutputContext.ByteOutputStream extends java.lang.Object implements TransferOutputStream
AnOutputStream
implementation which buffers data toByteBuf
s.Public methods are thread safe, although the execution order may not be linearized if they were called from different threads.
-
-
Constructor Summary
Constructors Constructor Description ByteOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this output stream.void
writeElement(java.lang.Object element, Serializer serializer)
Write an element to the channel.ByteOutputContext.ByteOutputStream
writeFileArea(FileArea fileArea)
Writes a data frame fromFileArea
.ByteOutputContext.ByteOutputStream
writeSerializedPartitionBuffer(SerializedPartition serializedPartition, boolean releaseOnComplete)
WritesSerializedPartition
.
-
-
-
Method Detail
-
writeSerializedPartitionBuffer
public ByteOutputContext.ByteOutputStream writeSerializedPartitionBuffer(SerializedPartition serializedPartition, boolean releaseOnComplete) throws java.io.IOException
WritesSerializedPartition
.- Parameters:
serializedPartition
-SerializedPartition
to write.releaseOnComplete
- wheter to release the partition upon completion.- Returns:
this
- Throws:
java.io.IOException
- when an exception has been set or this stream was closed
-
writeFileArea
public ByteOutputContext.ByteOutputStream writeFileArea(FileArea fileArea) throws java.io.IOException
Writes a data frame fromFileArea
.- Parameters:
fileArea
- theFileArea
to transfer- Returns:
this
- Throws:
java.io.IOException
- when failed to open the file, an exception has been set, or this stream was closed
-
close
public void close() throws java.io.IOException
Description copied from interface:TransferOutputStream
Closes this output stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceTransferOutputStream
- Throws:
java.io.IOException
- if any exception has occurred. For more information, seeByteOutputContext.close()
.
-
writeElement
public void writeElement(java.lang.Object element, Serializer serializer)
Write an element to the channel.- Specified by:
writeElement
in interfaceTransferOutputStream
- Parameters:
element
- elementserializer
- serializer
-
-