attilapiros commented on a change in pull request #24241:
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r271012496
##########
File path:
core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala
##########
@@ -363,17 +361,14 @@ private[spark] class ExternalSorter[K, V, C](
* Merge-sort a sequence of (K, C) iterators using a given a comparator for
the keys.
*/
private def mergeSort(iterators: Seq[Iterator[Product2[K, C]]], comparator:
Comparator[K])
- : Iterator[Product2[K, C]] =
- {
+ : Iterator[Product2[K, C]] = {
val bufferedIters = iterators.filter(_.hasNext).map(_.buffered)
type Iter = BufferedIterator[Product2[K, C]]
- val heap = new mutable.PriorityQueue[Iter]()(new Ordering[Iter] {
- // Use the reverse order because PriorityQueue dequeues the max
- override def compare(x: Iter, y: Iter): Int =
comparator.compare(y.head._1, x.head._1)
- })
+ val heap = new mutable.PriorityQueue[Iter]()(
Review comment:
Now I am checking for missing comments by `grep`. It is semi-automatic so I
am just sharing you the places I have found, here we lost:
```
// Use the reverse order because PriorityQueue dequeues the max
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]