vanzin commented on a change in pull request #26170: [SPARK-29397][core] Extend
plugin interface to include the driver.
URL: https://github.com/apache/spark/pull/26170#discussion_r338807721
##########
File path: core/src/main/scala/org/apache/spark/SparkContext.scala
##########
@@ -539,6 +541,9 @@ class SparkContext(config: SparkConf) extends Logging {
_heartbeatReceiver = env.rpcEnv.setupEndpoint(
HeartbeatReceiver.ENDPOINT_NAME, new HeartbeatReceiver(this))
+ // Initialize any plugins before the task scheduler is initialized.
+ _plugins = PluginContainer(this)
Review comment:
Ok, here's what happens. If you add a metric to the registry after you
register it as a source, those metrics don't show up. At least not in
`ConsoleSink`. So it's ok to register the source at the point you mention as
long as all metrics have been registered before then.
I'll add a new method to the driver plugins for explicitly registering
metrics; that way initialization can happen early, and metrics initialization
later. It diverges a bit from the executor API, but I don't see a much better
alternative. To be able to register plugin RPC endpoints before executors are
up, initialization needs to happen early.
(That also avoids a warning from the metrics system in the output when you
register a source before an app ID is known.)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]