Skip to content

Commit b3f9a95

Browse files
Disable dynamic allocation and kill app if it is enabled.
1 parent a4a5212 commit b3f9a95

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,9 @@ class StreamingContext private[streaming] (
565565
}
566566
}
567567

568-
if (Utils.isDynamicAllocationEnabled(sc.conf)) {
569-
val maxExecutors = sc.conf.getInt("spark.dynamicAllocation.maxExecutors", 2)
570-
sc.conf.set("spark.dynamicAllocation.enabled", false.toString)
571-
sc.conf.set("spark.executor.instances", maxExecutors.toString)
572-
logWarning("Dynamic allocation is not supported with Spark Streaming currently, since it " +
573-
s"could lead to data loss in some cases. " +
574-
s"The number of executors is being set to $maxExecutors")
575-
}
568+
require(!Utils.isDynamicAllocationEnabled(sc.conf),
569+
"Dynamic allocation is not supported with Spark Streaming currently, since it " +
570+
s"could lead to data loss in some cases. ")
576571
}
577572

578573
/**

0 commit comments

Comments
 (0)