liuxunorg commented on a change in pull request #3389: [ZEPPELIN-4209] Fixed
the ClusterInterpreterLauncher can not listen cluster events
URL: https://github.com/apache/zeppelin/pull/3389#discussion_r299746879
##########
File path:
zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
##########
@@ -358,6 +361,22 @@ private static void
setupClusterManagerServer(ServiceLocator serviceLocator) {
AuthorizationService authorizationService =
serviceLocator.getService(AuthorizationService.class);
clusterManagerServer.addClusterEventListeners(ClusterManagerServer.CLUSTER_NOTE_EVENT_TOPIC,
notebookServer);
clusterManagerServer.addClusterEventListeners(ClusterManagerServer.CLUSTER_AUTH_EVENT_TOPIC,
authorizationService);
+
+ // Since the ClusterInterpreterLauncher is lazy, dynamically generated,
So in cluster mode,
+ // when the zeppelin service starts, Create a ClusterInterpreterLauncher
object,
+ // This allows the ClusterInterpreterLauncher to listen for cluster
events.
+ try {
+ InterpreterSettingManager intpSettingManager =
sharedServiceLocator.getService(InterpreterSettingManager.class);
+ RecoveryStorage recoveryStorage = ReflectionUtils.createClazzInstance(
+ conf.getRecoveryStorageClass(),
+ new Class[] {ZeppelinConfiguration.class,
InterpreterSettingManager.class},
+ new Object[] {conf, intpSettingManager});
+ recoveryStorage.init();
+
PluginManager.get().loadInterpreterLauncher(InterpreterSetting.CLUSTER_INTERPRETER_LAUNCHER_NAME,
recoveryStorage);
Review comment:
Since the `ClusterInterpreterLauncher` is lazy, dynamically generated, So in
cluster mode,
When the user needs to create an interpreter on the cluster (for example:
`node A`)
If the `A node` has never created an interpreter and never initialized the
`ClusterInterpreterLauncher` object, then the `ClusterInterpreterLauncher`
object on the a node will not be able to listen to the create interpreter event
sent to it by the cluster.
Therefore, in cluster mode, the `ClusterInterpreterLauncher` object needs to
be initialized in advance when the zeppelin server is started.
----------------------------------------------------------------
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