Search in sources :

Example 1 with NodeDiscoveryProvider

use of io.atomix.cluster.discovery.NodeDiscoveryProvider in project atomix by atomix.

the class SwimProtocolTest method startProtocol.

private SwimMembershipProtocol startProtocol(Member member) {
    SwimMembershipProtocol protocol = new SwimMembershipProtocol(new SwimMembershipProtocolConfig().setFailureTimeout(Duration.ofSeconds(2)));
    TestGroupMembershipEventListener listener = new TestGroupMembershipEventListener();
    listeners.put(member.id(), listener);
    protocol.addListener(listener);
    BootstrapService bootstrap = new TestBootstrapService(messagingServiceFactory.newMessagingService(member.address()).start().join(), unicastServiceFactory.newUnicastService(member.address()).start().join(), broadcastServiceFactory.newBroadcastService().start().join());
    NodeDiscoveryProvider provider = new BootstrapDiscoveryProvider(nodes);
    provider.join(bootstrap, member).join();
    NodeDiscoveryService discovery = new DefaultNodeDiscoveryService(bootstrap, member, provider).start().join();
    protocol.join(bootstrap, discovery, member).join();
    protocols.put(member.id(), protocol);
    return protocol;
}
Also used : DefaultNodeDiscoveryService(io.atomix.cluster.impl.DefaultNodeDiscoveryService) TestBootstrapService(io.atomix.cluster.TestBootstrapService) BootstrapDiscoveryProvider(io.atomix.cluster.discovery.BootstrapDiscoveryProvider) NodeDiscoveryProvider(io.atomix.cluster.discovery.NodeDiscoveryProvider) NodeDiscoveryService(io.atomix.cluster.discovery.NodeDiscoveryService) DefaultNodeDiscoveryService(io.atomix.cluster.impl.DefaultNodeDiscoveryService) TestBootstrapService(io.atomix.cluster.TestBootstrapService) BootstrapService(io.atomix.cluster.BootstrapService)

Aggregations

BootstrapService (io.atomix.cluster.BootstrapService)1 TestBootstrapService (io.atomix.cluster.TestBootstrapService)1 BootstrapDiscoveryProvider (io.atomix.cluster.discovery.BootstrapDiscoveryProvider)1 NodeDiscoveryProvider (io.atomix.cluster.discovery.NodeDiscoveryProvider)1 NodeDiscoveryService (io.atomix.cluster.discovery.NodeDiscoveryService)1 DefaultNodeDiscoveryService (io.atomix.cluster.impl.DefaultNodeDiscoveryService)1