Package org.apache.spark.shuffle.api
Interface ShuffleExecutorComponents
@Private
public interface ShuffleExecutorComponents
:: Private ::
An interface for building shuffle support for Executors.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateMapOutputWriter
(int shuffleId, long mapTaskId, int numPartitions) Called once per map task to create a writer that will be responsible for persisting all the partitioned bytes written by that map task.createSingleFileMapOutputWriter
(int shuffleId, long mapId) An optional extension for creating a map output writer that can optimize the transfer of a single partition file, as the entire result of a map task, to the backing store.void
Called once per executor to bootstrap this module with state that is specific to that executor, specifically the application ID and executor ID.
-
Method Details
-
initializeExecutor
Called once per executor to bootstrap this module with state that is specific to that executor, specifically the application ID and executor ID.- Parameters:
appId
- The Spark application idexecId
- The unique identifier of the executor being initializedextraConfigs
- Extra configs that were returned byShuffleDriverComponents.initializeApplication()
-
createMapOutputWriter
ShuffleMapOutputWriter createMapOutputWriter(int shuffleId, long mapTaskId, int numPartitions) throws IOException Called once per map task to create a writer that will be responsible for persisting all the partitioned bytes written by that map task.- Parameters:
shuffleId
- Unique identifier for the shuffle the map task is a part ofmapTaskId
- An ID of the map task. The ID is unique within this Spark application.numPartitions
- The number of partitions that will be written by the map task. Some of these partitions may be empty.- Throws:
IOException
-
createSingleFileMapOutputWriter
default Optional<SingleSpillShuffleMapOutputWriter> createSingleFileMapOutputWriter(int shuffleId, long mapId) throws IOException An optional extension for creating a map output writer that can optimize the transfer of a single partition file, as the entire result of a map task, to the backing store.Most implementations should return the default
Optional.empty()
to indicate that they do not support this optimization. This primarily is for backwards-compatibility in preserving an optimization in the local disk shuffle storage implementation.- Parameters:
shuffleId
- Unique identifier for the shuffle the map task is a part ofmapId
- An ID of the map task. The ID is unique within this Spark application.- Throws:
IOException
-