use of org.apache.zeppelin.service.ConfigurationService in project zeppelin by apache.
the class ClusterEventTest method init.
@BeforeClass
public static void init() throws Exception {
ZeppelinConfiguration zconf = genZeppelinConf();
ZeppelinServerMock.startUp("ClusterEventTest", zconf);
notebook = TestUtils.getInstance(Notebook.class);
authorizationService = TestUtils.getInstance(AuthorizationService.class);
schedulerService = new QuartzSchedulerService(zconf, notebook);
schedulerService.waitForFinishInit();
notebookServer = spy(NotebookServer.getInstance());
notebookService = new NotebookService(notebook, authorizationService, zconf, schedulerService);
ConfigurationService configurationService = new ConfigurationService(notebook.getConf());
when(notebookServer.getNotebookService()).thenReturn(notebookService);
when(notebookServer.getConfigurationService()).thenReturn(configurationService);
startOtherZeppelinClusterNode(zconf);
// wait zeppelin cluster startup
Thread.sleep(10000);
// mock cluster manager client
clusterClient = ClusterManagerClient.getInstance(zconf);
clusterClient.start(metaKey);
// Waiting for cluster startup
int wait = 0;
while (wait++ < 100) {
if (clusterIsStartup() && clusterClient.raftInitialized()) {
LOGGER.info("wait {}(ms) found cluster leader", wait * 500);
break;
}
try {
Thread.sleep(500);
} catch (InterruptedException e) {
LOGGER.error(e.getMessage(), e);
}
}
Thread.sleep(3000);
assertEquals(true, clusterIsStartup());
getClusterServerMeta();
}
Aggregations