Skip to content

Commit

Permalink
head of empty list execpeiton fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
swasti committed Dec 12, 2017
1 parent cf29600 commit 492cf34
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ object JvmUsedMemoryHeuristic {
val executorList : Seq[ExecutorSummary] = executorSummaries.filterNot(_.id.equals("driver"))
val sparkExecutorMemory : Long = (appConfigurationProperties.get(SPARK_EXECUTOR_MEMORY).map(MemoryFormatUtils.stringToBytes)).getOrElse(0L)
val sparkDriverMemory : Long = appConfigurationProperties.get(SPARK_DRIVER_MEMORY).map(MemoryFormatUtils.stringToBytes).getOrElse(0L)
val medianPeakJvmUsedMemory: Long = executorList.map {
val medianPeakJvmUsedMemory: Long = if (executorList.isEmpty) 0L else executorList.map {
_.peakJvmUsedMemory.getOrElse(JVM_USED_MEMORY, 0L).asInstanceOf[Number].longValue
}.sortWith(_< _).drop(executorList.size/2).head
lazy val maxExecutorPeakJvmUsedMemory: Long = executorList.map {
_.peakJvmUsedMemory.getOrElse(JVM_USED_MEMORY, 0L)
lazy val maxExecutorPeakJvmUsedMemory: Long = if (executorList.isEmpty) 0L else executorList.map {
_.peakJvmUsedMemory.getOrElse(JVM_USED_MEMORY, 0).asInstanceOf[Number].longValue
}.max

val DEFAULT_MAX_EXECUTOR_PEAK_JVM_USED_MEMORY_THRESHOLDS =
Expand Down

0 comments on commit 492cf34

Please sign in to comment.