Search in sources :

Example 6 with MessagingConfig

use of io.atomix.cluster.messaging.MessagingConfig in project atomix by atomix.

the class RaftFuzzTest method createServer.

/**
 * Creates a Raft server.
 */
private RaftServer createServer(RaftMember member) {
    RaftServerProtocol protocol;
    if (USE_NETTY) {
        Address address = Address.from(++port);
        MessagingService messagingManager = new NettyMessagingService("test", address, new MessagingConfig()).start().join();
        messagingServices.add(messagingManager);
        addressMap.put(member.memberId(), address);
        protocol = new RaftServerMessagingProtocol(messagingManager, PROTOCOL_SERIALIZER, addressMap::get);
    } else {
        protocol = protocolFactory.newServerProtocol(member.memberId());
    }
    RaftServer.Builder builder = RaftServer.builder(member.memberId()).withProtocol(protocol).withStorage(RaftStorage.builder().withStorageLevel(StorageLevel.DISK).withDirectory(new File(String.format("target/fuzz-logs/%s", member.memberId()))).withNamespace(STORAGE_NAMESPACE).withMaxSegmentSize(1024 * 1024).build());
    RaftServer server = builder.build();
    servers.add(server);
    return server;
}
Also used : MessagingConfig(io.atomix.cluster.messaging.MessagingConfig) RaftServerProtocol(io.atomix.protocols.raft.protocol.RaftServerProtocol) RaftServerMessagingProtocol(io.atomix.protocols.raft.test.protocol.RaftServerMessagingProtocol) Address(io.atomix.utils.net.Address) RaftServer(io.atomix.protocols.raft.RaftServer) NettyMessagingService(io.atomix.cluster.messaging.impl.NettyMessagingService) File(java.io.File) MessagingService(io.atomix.cluster.messaging.MessagingService) NettyMessagingService(io.atomix.cluster.messaging.impl.NettyMessagingService)

Aggregations

MessagingConfig (io.atomix.cluster.messaging.MessagingConfig)6 NettyMessagingService (io.atomix.cluster.messaging.impl.NettyMessagingService)4 MessagingService (io.atomix.cluster.messaging.MessagingService)3 ManagedMessagingService (io.atomix.cluster.messaging.ManagedMessagingService)2 HeartbeatMembershipProtocolConfig (io.atomix.cluster.protocol.HeartbeatMembershipProtocolConfig)2 RaftClient (io.atomix.protocols.raft.RaftClient)2 RaftServer (io.atomix.protocols.raft.RaftServer)2 RaftClientProtocol (io.atomix.protocols.raft.protocol.RaftClientProtocol)2 RaftServerProtocol (io.atomix.protocols.raft.protocol.RaftServerProtocol)2 RaftClientMessagingProtocol (io.atomix.protocols.raft.test.protocol.RaftClientMessagingProtocol)2 RaftServerMessagingProtocol (io.atomix.protocols.raft.test.protocol.RaftServerMessagingProtocol)2 Address (io.atomix.utils.net.Address)2 File (java.io.File)2 BootstrapService (io.atomix.cluster.BootstrapService)1 ClusterConfig (io.atomix.cluster.ClusterConfig)1 Member (io.atomix.cluster.Member)1 MemberConfig (io.atomix.cluster.MemberConfig)1 MemberId (io.atomix.cluster.MemberId)1 MembershipConfig (io.atomix.cluster.MembershipConfig)1 MulticastConfig (io.atomix.cluster.MulticastConfig)1