Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/18948#discussion_r133451311
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
@@ -144,6 +144,13 @@ class StreamingContext private[streaming] (
}
}
+ if (sc.conf.contains("spark.cores.max")) {
+ val totalCores = sc.conf.getInt("spark.cores.max", 1)
--- End diff --
AFAIK, "spark.cores.max" is not set by default, with your change it will
always return 1 if not set and throws exception as you wrote.
Besides if there're several receivers in streaming application, even > 1 is
not sufficient. So simply checking "spark.cores.max" is not a feasible way to
address the issue, and there may not be a good way to handle this problem
properly, so I'd suggest to leave the current code as it is.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]