use of org.apache.ignite.network.TestMessageSerializationRegistryImpl in project ignite-3 by apache.
the class ItRecoveryHandshakeTest method startManager.
/**
* Starts a {@link ConnectionManager} with a normal handshake manager adding it to the {@link #startedManagers} list.
*
* @param port Port.
* @return Connection manager
*/
private ConnectionManager startManager(int port) {
var registry = new TestMessageSerializationRegistryImpl();
var serializationService = new SerializationService(registry, mock(UserObjectSerializationContext.class));
var messageFactory = new NetworkMessagesFactory();
UUID launchId = UUID.randomUUID();
String consistentId = UUID.randomUUID().toString();
networkConfiguration.port().update(port).join();
NetworkView cfg = networkConfiguration.value();
NettyBootstrapFactory bootstrapFactory = new NettyBootstrapFactory(networkConfiguration, consistentId);
bootstrapFactory.start();
startedBootstrapFactories.add(bootstrapFactory);
var manager = new ConnectionManager(cfg, serializationService, consistentId, () -> new RecoveryServerHandshakeManager(launchId, consistentId, messageFactory), () -> new RecoveryClientHandshakeManager(launchId, consistentId, messageFactory), bootstrapFactory);
manager.start();
startedManagers.add(manager);
return manager;
}
use of org.apache.ignite.network.TestMessageSerializationRegistryImpl in project ignite-3 by apache.
the class ItRecoveryHandshakeTest method startManager.
/**
* Starts a {@link ConnectionManager} adding it to the {@link #startedManagers} list.
*
* @param port Port for the server.
* @param serverHandshakeFailAt At what stage to fail server handshake.
* @param clientHandshakeFailAt At what stage to fail client handshake.
* @return Connection manager.
*/
private ConnectionManager startManager(int port, ServerStageFail serverHandshakeFailAt, ClientStageFail clientHandshakeFailAt) {
var registry = new TestMessageSerializationRegistryImpl();
var serializationService = new SerializationService(registry, mock(UserObjectSerializationContext.class));
var messageFactory = new NetworkMessagesFactory();
UUID launchId = UUID.randomUUID();
String consistentId = UUID.randomUUID().toString();
networkConfiguration.port().update(port).join();
NetworkView cfg = networkConfiguration.value();
NettyBootstrapFactory bootstrapFactory = new NettyBootstrapFactory(networkConfiguration, consistentId);
bootstrapFactory.start();
startedBootstrapFactories.add(bootstrapFactory);
var manager = new ConnectionManager(cfg, serializationService, consistentId, () -> new FailingRecoveryServerHandshakeManager(launchId, consistentId, serverHandshakeFailAt, messageFactory), () -> new FailingRecoveryClientHandshakeManager(launchId, consistentId, clientHandshakeFailAt, messageFactory), bootstrapFactory);
manager.start();
startedManagers.add(manager);
return manager;
}
Aggregations