dongjoon-hyun commented on a change in pull request #26266: 
[SPARK-29611][WEBUI] Sort Kafka metadata by the number of messages
URL: https://github.com/apache/spark/pull/26266#discussion_r341795501
 
 

 ##########
 File path: 
external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala
 ##########
 @@ -237,9 +237,10 @@ private[spark] class DirectKafkaInputDStream[K, V](
     val description = offsetRanges.filter { offsetRange =>
       // Don't display empty ranges.
       offsetRange.fromOffset != offsetRange.untilOffset
-    }.map { offsetRange =>
+    }.toSeq.sortBy(-_.count()).map { offsetRange =>
       s"topic: ${offsetRange.topic}\tpartition: ${offsetRange.partition}\t" +
-        s"offsets: ${offsetRange.fromOffset} to ${offsetRange.untilOffset}"
+        s"offsets: ${offsetRange.fromOffset} to ${offsetRange.untilOffset}\t" +
+          s"count: ${offsetRange.count()}"
 
 Review comment:
   nit. Shall we align like the following? For string concatenation, we cannot 
add two spaces every lines incrementally.
   ```scala
   s"topic: ${offsetRange.topic}\tpartition: ${offsetRange.partition}\t" +
   s"offsets: ${offsetRange.fromOffset} to ${offsetRange.untilOffset}\t" +
   s"count: ${offsetRange.count()}"
   ```

----------------------------------------------------------------
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]

Reply via email to