dongjoon-hyun commented on a change in pull request #29477:
URL: https://github.com/apache/spark/pull/29477#discussion_r475288507
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
##########
@@ -323,4 +324,25 @@ private[spark] object KubernetesUtils extends Logging {
.build()
}
}
+
+ /**
+ * Convert MEMORY_OFFHEAP_SIZE to MB Unit, return 0 if
MEMORY_OFFHEAP_ENABLED is false.
+ */
+ def executorOffHeapMemorySizeAsMb(kubernetesConf: KubernetesExecutorConf):
Int = {
+ val sizeInMB =
Utils.memoryStringToMb(kubernetesConf.get(MEMORY_OFFHEAP_SIZE).toString)
+ checkOffHeapEnabled(kubernetesConf, sizeInMB).toInt
+ }
+
+ /**
+ * return 0 if MEMORY_OFFHEAP_ENABLED is false.
+ */
+ def checkOffHeapEnabled(kubernetesConf: KubernetesExecutorConf, offHeapSize:
Long): Long = {
Review comment:
Shall we merge this into `executorOffHeapMemorySizeAsMb`?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]