-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-32055][CORE][SQL] Unify getReader and getReaderForRange in ShuffleManager #28895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
08a8f74
f2d28dd
356cd50
84a661a
5496bbf
05fe4c7
2a31450
819e3e9
a487a32
62cc46c
109eeb3
fbef8d2
b7ec583
2994050
4247fa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| package org.apache.spark.shuffle | ||
|
|
||
| import org.apache.spark.{ShuffleDependency, TaskContext} | ||
| import org.apache.spark.scheduler.MapStatus | ||
|
|
||
| /** | ||
| * Pluggable interface for shuffle systems. A ShuffleManager is created in SparkEnv on the driver | ||
|
|
@@ -43,26 +44,14 @@ 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]( | ||
|
Ngone51 marked this conversation as resolved.
|
||
| 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 map output which specified by mapIndexRange. | ||
| * 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), | ||
|
Ngone51 marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with the parameters of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is we can not know the |
||
| startPartition: Int, | ||
| endPartition: Int, | ||
| context: TaskContext, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
mapStatus => (0, mapStatus.length)seems to be used frequently, do you think we can define this function somewhere to prevent mistakes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sounds good.