use of org.elasticsearch.indices.breaker.NoneCircuitBreakerService in project crate by crate.
the class TcpTransportTests method testDefaultSeedAddresses.
private void testDefaultSeedAddresses(final Settings settings, Matcher<Iterable<? extends String>> seedAddressesMatcher) {
final TestThreadPool testThreadPool = new TestThreadPool("test");
try {
final TcpTransport tcpTransport = new TcpTransport(settings, Version.CURRENT, testThreadPool, new MockPageCacheRecycler(settings), new NoneCircuitBreakerService(), writableRegistry(), new NetworkService(Collections.emptyList())) {
@Override
protected TcpServerChannel bind(String name, InetSocketAddress address) {
throw new UnsupportedOperationException();
}
@Override
protected TcpChannel initiateChannel(DiscoveryNode node) {
throw new UnsupportedOperationException();
}
@Override
protected void stopInternal() {
throw new UnsupportedOperationException();
}
};
assertThat(tcpTransport.getDefaultSeedAddresses(), seedAddressesMatcher);
} finally {
testThreadPool.shutdown();
}
}
use of org.elasticsearch.indices.breaker.NoneCircuitBreakerService in project crate by crate.
the class TransportServiceHandshakeTests method startServices.
private NetworkHandle startServices(String nodeNameAndId, Settings settings, Version version) {
var allSettings = Settings.builder().put(TransportSettings.PORT.getKey(), ESTestCase.getPortRange()).put(settings).build();
var transport = new Netty4Transport(allSettings, // handle the real world scenario instead of a faked one.
Version.CURRENT, threadPool, new NetworkService(Collections.emptyList()), PageCacheRecycler.NON_RECYCLING_INSTANCE, new NamedWriteableRegistry(Collections.emptyList()), new NoneCircuitBreakerService(), new NettyBootstrap(), new AlwaysOKAuthentication(userName -> User.CRATE_USER), new SslContextProvider(settings));
TransportService transportService = new MockTransportService(allSettings, transport, threadPool, (boundAddress) -> new DiscoveryNode(nodeNameAndId, nodeNameAndId, boundAddress.publishAddress(), emptyMap(), emptySet(), version), null);
transportService.start();
transportService.acceptIncomingRequests();
transportServices.add(transportService);
return new NetworkHandle(transportService, transportService.getLocalNode());
}
Aggregations