use of com.alibaba.maxgraph.servers.maxgraph.ExecutorDiscoveryManager in project GraphScope by alibaba.
the class ExecutorDiscoveryManagerTest method testExecutorServerStart.
@Test
void testExecutorServerStart() throws Exception {
try (TestingServer testingServer = new TestingServer(-1)) {
int zkPort = testingServer.getPort();
Configs configs = Configs.newBuilder().put(ZkConfig.ZK_CONNECT_STRING.getKey(), "localhost:" + zkPort).put(ZkConfig.ZK_BASE_PATH.getKey(), "test_discovery").build();
CuratorFramework curator = CuratorUtils.makeCurator(configs);
curator.start();
LocalNodeProvider engineServerProvider = new LocalNodeProvider(RoleType.EXECUTOR_ENGINE, configs);
NodeDiscovery engineServerDiscovery = new ZkDiscovery(configs, engineServerProvider, curator);
LocalNodeProvider storeQueryProvider = new LocalNodeProvider(RoleType.EXECUTOR_GRAPH, configs);
NodeDiscovery storeQueryDiscovery = new ZkDiscovery(configs, storeQueryProvider, curator);
LocalNodeProvider queryExecuteProvider = new LocalNodeProvider(RoleType.EXECUTOR_QUERY, configs);
NodeDiscovery queryExecuteDiscovery = new ZkDiscovery(configs, queryExecuteProvider, curator);
LocalNodeProvider queryManageProvider = new LocalNodeProvider(RoleType.EXECUTOR_MANAGE, configs);
NodeDiscovery queryManageDiscovery = new ZkDiscovery(configs, queryManageProvider, curator);
ExecutorDiscoveryManager executorDiscoveryManager = new ExecutorDiscoveryManager(engineServerProvider, engineServerDiscovery, storeQueryProvider, storeQueryDiscovery, queryExecuteProvider, queryExecuteDiscovery, queryManageProvider, queryManageDiscovery);
executorDiscoveryManager.getEngineServerProvider().apply(123);
executorDiscoveryManager.getEngineServerDiscovery().start();
executorDiscoveryManager.getQueryExecuteProvider().apply(1234);
executorDiscoveryManager.getQueryExecuteDiscovery().start();
}
}
Aggregations