Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,7 @@ private[streaming] object ExecutorAllocationManager extends Logging {
val MAX_EXECUTORS_KEY = "spark.streaming.dynamicAllocation.maxExecutors"

def isDynamicAllocationEnabled(conf: SparkConf): Boolean = {
val numExecutor = conf.getInt("spark.executor.instances", 0)
val streamingDynamicAllocationEnabled = conf.getBoolean(ENABLED_KEY, false)
if (numExecutor != 0 && streamingDynamicAllocationEnabled) {
throw new IllegalArgumentException(
"Dynamic Allocation for streaming cannot be enabled while spark.executor.instances is set.")
}
if (Utils.isDynamicAllocationEnabled(conf) && streamingDynamicAllocationEnabled) {
throw new IllegalArgumentException(
"""
Expand All @@ -217,7 +212,7 @@ private[streaming] object ExecutorAllocationManager extends Logging {
""".stripMargin)
}
val testing = conf.getBoolean("spark.streaming.dynamicAllocation.testing", false)
numExecutor == 0 && streamingDynamicAllocationEnabled && (!Utils.isLocalMaster(conf) || testing)
streamingDynamicAllocationEnabled && (!Utils.isLocalMaster(conf) || testing)
}

def createIfEnabled(
Expand Down