ivoson commented on code in PR #36716: URL: https://github.com/apache/spark/pull/36716#discussion_r893595106
########## core/src/main/scala/org/apache/spark/deploy/ApplicationDescription.scala: ########## @@ -19,23 +19,28 @@ package org.apache.spark.deploy import java.net.URI -import org.apache.spark.resource.ResourceRequirement +import org.apache.spark.resource.{ResourceProfile, ResourceRequirement, ResourceUtils} +import org.apache.spark.resource.ResourceProfile.getCustomExecutorResources private[spark] case class ApplicationDescription( name: String, maxCores: Option[Int], - memoryPerExecutorMB: Int, command: Command, appUiUrl: String, + defaultProfile: ResourceProfile, eventLogDir: Option[URI] = None, // short name of compression codec used when writing event logs, if any (e.g. lzf) eventLogCodec: Option[String] = None, - coresPerExecutor: Option[Int] = None, // number of executors this application wants to start with, // only used if dynamic allocation is enabled initialExecutorLimit: Option[Int] = None, - user: String = System.getProperty("user.name", "<unknown>"), - resourceReqsPerExecutor: Seq[ResourceRequirement] = Seq.empty) { + user: String = System.getProperty("user.name", "<unknown>")) { + + def memoryPerExecutorMB: Int = defaultProfile.getExecutorMemory.map(_.toInt).getOrElse(1024) + def coresPerExecutor: Option[Int] = defaultProfile.getExecutorCores + def resourceReqsPerExecutor: Seq[ResourceRequirement] = + ResourceUtils.executorResourceRequestToRequirement( + getCustomExecutorResources(defaultProfile).values.toSeq.sortBy(_.resourceName)) Review Comment: Sure, will make the change. Thanks. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org