T
- the type of elementpublic final class BlockOutputStream<T> extends Object implements AutoCloseable, BlockStream
close()
must be called after finishing write.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream.
|
void |
closeExceptionally(Throwable cause)
Closes this stream, exceptionally.
|
String |
getBlockId()
Gets the block id.
|
Optional<DataStoreProperty.Value> |
getBlockStore()
Gets the block store type.
|
KeyRange |
getKeyRange()
Gets the key range.
|
String |
getRemoteExecutorId()
Gets the id of the remote executor.
|
String |
getRuntimeEdgeId()
Gets the runtime edge id.
|
boolean |
isEncodePartialBlockEnabled()
Gets whether the sender should start encoding even though the whole block has not been written yet.
|
String |
toString() |
BlockOutputStream |
writeElements(Iterator<T> iterator)
Writes a
Iterable of elements. |
BlockOutputStream |
writeFileAreas(Iterable<FileArea> fileAreas)
|
BlockOutputStream |
writeSerializedPartitions(Iterable<SerializedPartition> serializedPartitions)
Writes a collection of
SerializedPartition s. |
public String getRemoteExecutorId()
BlockStream
getRemoteExecutorId
in interface BlockStream
public boolean isEncodePartialBlockEnabled()
BlockStream
isEncodePartialBlockEnabled
in interface BlockStream
public Optional<DataStoreProperty.Value> getBlockStore()
BlockStream
getBlockStore
in interface BlockStream
Optional
with block store type if this stream belongs to a pull-based transfer,
an empty Optional
otherwise.public String getBlockId()
BlockStream
getBlockId
in interface BlockStream
public String getRuntimeEdgeId()
BlockStream
getRuntimeEdgeId
in interface BlockStream
public KeyRange getKeyRange()
BlockStream
getKeyRange
in interface BlockStream
KeyRange
public BlockOutputStream writeElements(Iterator<T> iterator) throws IOException
Iterable
of elements.iterator
- the Iterator
to writeBlockOutputStream
(i.e. this
)IOException
- if an exception was setIllegalStateException
- if this stream is closed alreadypublic BlockOutputStream writeFileAreas(Iterable<FileArea> fileAreas) throws IOException
fileAreas
- the list of the file areasBlockOutputStream
(i.e. this
)IOException
- if an exception was setIllegalStateException
- if this stream is closed alreadypublic BlockOutputStream writeSerializedPartitions(Iterable<SerializedPartition> serializedPartitions) throws IOException
SerializedPartition
s.serializedPartitions
- the collection of SerializedPartition
BlockOutputStream
(i.e. this
)IOException
- if an exception was setIllegalStateException
- if this stream is closed alreadypublic void close() throws IOException
close
in interface AutoCloseable
IOException
- if an exception was setIllegalStateException
- if this stream is closed alreadypublic void closeExceptionally(Throwable cause)
cause
- the cause of the exceptional control flowCopyright © 2018. All rights reserved.