zjffdu 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_r299744146
########## 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: Launcher will be created here https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java#L294 Why you do it again here ? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services