use of com.alibaba.graphscope.groot.rpc.ChannelManager in project GraphScope by alibaba.
the class RoleClientsTest method testRoleClients.
@Test
void testRoleClients() {
Configs configs = Configs.newBuilder().put(CommonConfig.STORE_NODE_COUNT.getKey(), "1").put(CommonConfig.DISCOVERY_MODE.getKey(), "zookeeper").build();
ChannelManager channelManager = new ChannelManager(configs, new MockFactory());
RoleClients<MockRoleClient> clients = new RoleClients<>(channelManager, RoleType.STORE, MockRoleClient::new);
channelManager.start();
assertNotNull(clients.getClient(0));
assertThrows(NodeConnectException.class, () -> clients.getClient(1));
channelManager.stop();
}
use of com.alibaba.graphscope.groot.rpc.ChannelManager in project GraphScope by alibaba.
the class ChannelManagerTest method testChannelManager.
@Test
void testChannelManager() {
Configs configs = Configs.newBuilder().put(CommonConfig.STORE_NODE_COUNT.getKey(), "1").put(CommonConfig.DISCOVERY_MODE.getKey(), "zookeeper").build();
ChannelManager channelManager = new ChannelManager(configs, new MockFactory());
channelManager.registerRole(RoleType.STORE);
channelManager.start();
Assertions.assertNotNull(channelManager.getChannel(RoleType.STORE, 0));
Assertions.assertThrows(NodeConnectException.class, () -> channelManager.getChannel(RoleType.STORE, 1));
channelManager.stop();
}
Aggregations