HeartSaVioR commented on a change in pull request #24935: [SPARK-28005][YARN]
Remove unnecessary log from SparkRackResolver
URL: https://github.com/apache/spark/pull/24935#discussion_r296606310
##########
File path:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/SparkRackResolver.scala
##########
@@ -72,8 +72,6 @@ private[spark] class SparkRackResolver(conf: Configuration)
extends Logging {
val rNameList = dnsToSwitchMapping.resolve(hostNames.toList.asJava).asScala
if (rNameList == null || rNameList.isEmpty) {
hostNames.foreach(nodes += new NodeBase(_, NetworkTopology.DEFAULT_RACK))
- logInfo(s"Got an error when resolving hostNames. " +
Review comment:
I'd say early return really fits in this case, as @squito said `In fact, the
entire function can be a no-op when hostNames.isEmpty`, but no strong opinion.
Looks like you don't need to indent one more, as it can be covered with
`else if` instead of `else then if`.
----------------------------------------------------------------
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]