diff --git a/common/src/main/scala/org/apache/celeborn/common/metrics/source/AbstractSource.scala b/common/src/main/scala/org/apache/celeborn/common/metrics/source/AbstractSource.scala index 878bf92e448..b1c13d83d2e 100644 --- a/common/src/main/scala/org/apache/celeborn/common/metrics/source/AbstractSource.scala +++ b/common/src/main/scala/org/apache/celeborn/common/metrics/source/AbstractSource.scala @@ -21,8 +21,8 @@ import java.lang import java.util.{Map => JMap} import java.util.concurrent.{ConcurrentHashMap, ScheduledExecutorService, TimeUnit} -import scala.collection.{breakOut, mutable} import scala.collection.JavaConverters._ +import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.util.Random @@ -512,8 +512,7 @@ abstract class AbstractSource(conf: CelebornConf, role: String) } var addNum = 0 val appCount0Metrics = ArrayBuffer[String]() - for (m <- metricList) { - if (addNum >= leftNum) breakOut + for (m <- metricList if addNum < leftNum) { var strMetrics = "" var isApp = false m match {