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;
}
Aggregations