cloud-fan commented on a change in pull request #28895:
URL: https://github.com/apache/spark/pull/28895#discussion_r443940713
##########
File path: core/src/main/scala/org/apache/spark/shuffle/ShuffleManager.scala
##########
@@ -43,26 +44,16 @@ private[spark] trait ShuffleManager {
context: TaskContext,
metrics: ShuffleWriteMetricsReporter): ShuffleWriter[K, V]
- /**
- * Get a reader for a range of reduce partitions (startPartition to
endPartition-1, inclusive).
- * Called on executors by reduce tasks.
- */
- def getReader[K, C](
- handle: ShuffleHandle,
- startPartition: Int,
- endPartition: Int,
- context: TaskContext,
- metrics: ShuffleReadMetricsReporter): ShuffleReader[K, C]
-
/**
* Get a reader for a range of reduce partitions (startPartition to
endPartition-1, inclusive) to
- * read from map output (startMapIndex to endMapIndex - 1, inclusive).
+ * read from a range of map outputs which specified by
mapIndexRange(startMapIndex to
+ * endMapIndex-1, inclusive).
+ *
* Called on executors by reduce tasks.
*/
- def getReaderForRange[K, C](
+ def getReader[K, C](
handle: ShuffleHandle,
- startMapIndex: Int,
- endMapIndex: Int,
+ mapIndexRange: Array[MapStatus] => (Int, Int),
Review comment:
It's a function only because we need to know the total number of
mappers? Maybe we can still use `startMapIndex: Int` and `endMapIndex: Int`,
caller side can use `Int.Max` as `endMapIndex`, to indicate that it wants to
read all the mappers.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]