dongjoon-hyun commented on a change in pull request #28528:
URL: https://github.com/apache/spark/pull/28528#discussion_r430176730



##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -121,7 +121,7 @@ private[spark] class Executor(
   // create. The map key is a task id.
   private val taskReaperForTask: HashMap[Long, TaskReaper] = HashMap[Long, 
TaskReaper]()
 
-  val executorMetricsSource =
+  private val executorMetricsSource =

Review comment:
       This is irrelevant to this PR.

##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -134,8 +134,11 @@ private[spark] class Executor(
     env.metricsSystem.registerSource(new JVMCPUSource())
     executorMetricsSource.foreach(_.register(env.metricsSystem))
     env.metricsSystem.registerSource(env.blockManager.shuffleMetricsSource)
+  } else {
+    Executor.executorSource = executorSource
   }
 
+

Review comment:
       Please remove this.

##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -121,7 +121,7 @@ private[spark] class Executor(
   // create. The map key is a task id.
   private val taskReaperForTask: HashMap[Long, TaskReaper] = HashMap[Long, 
TaskReaper]()
 
-  val executorMetricsSource =
+  private val executorMetricsSource =

Review comment:
       This seems to be irrelevant to this PR.

##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -134,8 +134,11 @@ private[spark] class Executor(
     env.metricsSystem.registerSource(new JVMCPUSource())
     executorMetricsSource.foreach(_.register(env.metricsSystem))
     env.metricsSystem.registerSource(env.blockManager.shuffleMetricsSource)
+  } else {
+    Executor.executorSource = executorSource

Review comment:
       What happens when we call 
`env.metricsSystem.registerSource(executorSource)` here? 

##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -134,8 +134,11 @@ private[spark] class Executor(
     env.metricsSystem.registerSource(new JVMCPUSource())
     executorMetricsSource.foreach(_.register(env.metricsSystem))
     env.metricsSystem.registerSource(env.blockManager.shuffleMetricsSource)
+  } else {
+    Executor.executorSource = executorSource

Review comment:
       What happens if we call 
`env.metricsSystem.registerSource(executorSource)` here? 

##########
File path: 
core/src/test/scala/org/apache/spark/metrics/source/SourceConfigSuite.scala
##########
@@ -80,4 +80,16 @@ class SourceConfigSuite extends SparkFunSuite with 
LocalSparkContext {
     }
   }
 
+  test("Test executor source registration in local mode") {

Review comment:
       Could you add a prefix `SPARK-31711: `?




----------------------------------------------------------------
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]

Reply via email to