Github user rezasafi commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22612#discussion_r233252552
  
    --- Diff: 
core/src/main/scala/org/apache/spark/metrics/ExecutorMetricType.scala ---
    @@ -19,18 +19,31 @@ package org.apache.spark.metrics
     import java.lang.management.{BufferPoolMXBean, ManagementFactory}
     import javax.management.ObjectName
     
    +import scala.collection.mutable
    +
    +import org.apache.spark.executor.ProcfsBasedSystems
     import org.apache.spark.memory.MemoryManager
     
     /**
      * Executor metric types for executor-level metrics stored in 
ExecutorMetrics.
      */
     sealed trait ExecutorMetricType {
    -  private[spark] def getMetricValue(memoryManager: MemoryManager): Long
    -  private[spark] val name = 
getClass().getName().stripSuffix("$").split("""\.""").last
    +  private[spark] def getMetricValue(memoryManager: MemoryManager): Long = 0
    +  private[spark] def getMetricSet(memoryManager: MemoryManager): 
Array[Long] = {
    +    new Array[Long](0)
    +  }
    +  private[spark] def names = 
Seq(getClass().getName().stripSuffix("$").split("""\.""").last)
    --- End diff --
    
    Thank you @squito for the comments. Better to finalize this before doing 
back and force.
    So what you suggest is that having two trait one for MetricTypes with one 
value (Lets call it SingleValueExecutorMetric) and one for MetricType with 
multiple Values (Lets call it MultiValueExecutorMetric). This I think will 
force us to have two metricGetters in ExecutorMetricType object as well, since 
one will call the getMetricValue and the other will call getMetricSet (or 
getMetricValues). Just wondering if I understand your suggestion correctly. 


---

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

Reply via email to