trait ShufflePartitionWriter extends AnyRef
:: Private :: An interface for opening streams to persist partition bytes to a backing data store.
This writer stores bytes for one (mapper, reducer) pair, corresponding to one shuffle block.
- Annotations
- @Private()
- Source
- ShufflePartitionWriter.java
- Since
3.0.0
- Alphabetic
- By Inheritance
- ShufflePartitionWriter
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def getNumBytesWritten(): Long
Returns the number of bytes written either by this writer's output stream opened by
#openStream()
or the byte channel opened by#openChannelWrapper()
.Returns the number of bytes written either by this writer's output stream opened by
#openStream()
or the byte channel opened by#openChannelWrapper()
.This can be different from the number of bytes given by the caller. For example, the stream might compress or encrypt the bytes before persisting the data to the backing data store.
- abstract def openStream(): OutputStream
Open and return an
OutputStream
that can write bytes to the underlying data store.Open and return an
OutputStream
that can write bytes to the underlying data store.This method will only be called once on this partition writer in the map task, to write the bytes to the partition. The output stream will only be used to write the bytes for this partition. The map task closes this output stream upon writing all the bytes for this block, or if the write fails for any reason.
Implementations that intend on combining the bytes for all the partitions written by this map task should reuse the same OutputStream instance across all the partition writers provided by the parent
ShuffleMapOutputWriter
. If one does so, ensure thatOutputStream#close()
does not close the resource, since it will be reused across partition writes. The underlying resources should be cleaned up inShuffleMapOutputWriter#commitAllPartitions(long[])
andShuffleMapOutputWriter#abort(Throwable)
.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def openChannelWrapper(): Optional[WritableByteChannelWrapper]
Opens and returns a
WritableByteChannelWrapper
for transferring bytes from input byte channels to the underlying shuffle data store.Opens and returns a
WritableByteChannelWrapper
for transferring bytes from input byte channels to the underlying shuffle data store.This method will only be called once on this partition writer in the map task, to write the bytes to the partition. The channel will only be used to write the bytes for this partition. The map task closes this channel upon writing all the bytes for this block, or if the write fails for any reason.
Implementations that intend on combining the bytes for all the partitions written by this map task should reuse the same channel instance across all the partition writers provided by the parent
ShuffleMapOutputWriter
. If one does so, ensure thatWritableByteChannelWrapper#close()
does not close the resource, since the channel will be reused across partition writes. The underlying resources should be cleaned up inShuffleMapOutputWriter#commitAllPartitions(long[])
andShuffleMapOutputWriter#abort(Throwable)
.This method is primarily for advanced optimizations where bytes can be copied from the input spill files to the output channel without copying data into memory. If such optimizations are not supported, the implementation should return
Optional#empty()
. By default, the implementation returnsOptional#empty()
.Note that the returned
WritableByteChannelWrapper
itself is closed, but not the underlying channel that is returned byWritableByteChannelWrapper#channel()
. Ensure that the underlying channel is cleaned up inWritableByteChannelWrapper#close()
,ShuffleMapOutputWriter#commitAllPartitions(long[])
, orShuffleMapOutputWriter#abort(Throwable)
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)