dongjoon-hyun commented on code in PR #52788:
URL: https://github.com/apache/spark/pull/52788#discussion_r2478923521
##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaOffsetReader.scala:
##########
@@ -167,3 +172,88 @@ private[kafka010] object KafkaOffsetReader extends Logging
{
}
}
}
+
+private[kafka010] abstract class KafkaOffsetReaderBase extends
KafkaOffsetReader with Logging {
+ protected val rangeCalculator: KafkaOffsetRangeCalculator
+
+ private def getSortedExecutorList: Array[String] = {
+ def compare(a: ExecutorCacheTaskLocation, b: ExecutorCacheTaskLocation):
Boolean = {
+ if (a.host == b.host) {
+ a.executorId > b.executorId
+ } else {
+ a.host > b.host
+ }
+ }
+
+ val bm = SparkEnv.get.blockManager
+ bm.master.getPeers(bm.blockManagerId).toArray
+ .map(x => ExecutorCacheTaskLocation(x.host, x.executorId))
+ .sortWith(compare)
+ .map(_.toString)
+ }
+
+ override def getOffsetRangesFromResolvedOffsets(
+ fromPartitionOffsets: PartitionOffsetMap,
Review Comment:
It seems that we have one less space here which is a different Indentation
from the original code, @viirya ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]