You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "bozhang2820 (via GitHub)" <gi...@apache.org> on 2023/05/11 07:14:27 UTC

[GitHub] [spark] bozhang2820 commented on a diff in pull request #41121: [SPARK-38467][CORE] Use error classes in org.apache.spark.memory

bozhang2820 commented on code in PR #41121:
URL: https://github.com/apache/spark/pull/41121#discussion_r1190731684


##########
core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala:
##########
@@ -216,17 +216,21 @@ object UnifiedMemoryManager {
       if (conf.contains(IS_TESTING)) 0 else RESERVED_SYSTEM_MEMORY_BYTES)
     val minSystemMemory = (reservedMemory * 1.5).ceil.toLong
     if (systemMemory < minSystemMemory) {
-      throw new IllegalArgumentException(s"System memory $systemMemory must " +
-        s"be at least $minSystemMemory. Please increase heap size using the --driver-memory " +
-        s"option or ${config.DRIVER_MEMORY.key} in Spark configuration.")
+      throw new SparkIllegalArgumentException(errorClass = "INVALID_DRIVER_MEMORY",
+        messageParameters = Map(
+          "systemMemory" -> systemMemory.toString,
+          "minSystemMemory" -> minSystemMemory.toString,
+          "config" -> config.DRIVER_MEMORY.key))

Review Comment:
   Wrapped in the message format. Is that good enough?



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org