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  
SerializedPartitions. | 
public String getRemoteExecutorId()
BlockStreamgetRemoteExecutorId in interface BlockStreampublic boolean isEncodePartialBlockEnabled()
BlockStreamisEncodePartialBlockEnabled in interface BlockStreampublic Optional<DataStoreProperty.Value> getBlockStore()
BlockStreamgetBlockStore in interface BlockStreamOptional with block store type if this stream belongs to a pull-based transfer,
         an empty Optional otherwise.public String getBlockId()
BlockStreamgetBlockId in interface BlockStreampublic String getRuntimeEdgeId()
BlockStreamgetRuntimeEdgeId in interface BlockStreampublic KeyRange getKeyRange()
BlockStreamgetKeyRange in interface BlockStreamKeyRangepublic 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
SerializedPartitions.serializedPartitions - the collection of SerializedPartitionBlockOutputStream (i.e. this)IOException - if an exception was setIllegalStateException - if this stream is closed alreadypublic void close()
           throws IOException
close in interface AutoCloseableIOException - 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.