Packages

t

org.apache.spark.shuffle.api

ShufflePartitionWriter

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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ShufflePartitionWriter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. 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.

  2. 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 that OutputStream#close() does not close the resource, since it will be reused across partition writes. The underlying resources should be cleaned up in ShuffleMapOutputWriter#commitAllPartitions(long[]) and ShuffleMapOutputWriter#abort(Throwable).

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. 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 that WritableByteChannelWrapper#close() does not close the resource, since the channel will be reused across partition writes. The underlying resources should be cleaned up in ShuffleMapOutputWriter#commitAllPartitions(long[]) and ShuffleMapOutputWriter#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 returns Optional#empty().

    Note that the returned WritableByteChannelWrapper itself is closed, but not the underlying channel that is returned by WritableByteChannelWrapper#channel(). Ensure that the underlying channel is cleaned up in WritableByteChannelWrapper#close(), ShuffleMapOutputWriter#commitAllPartitions(long[]), or ShuffleMapOutputWriter#abort(Throwable).

  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped