Search in sources :

Example 71 with NamedWriteableRegistry

use of org.elasticsearch.common.io.stream.NamedWriteableRegistry 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());
}
Also used : NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) BeforeClass(org.junit.BeforeClass) ArrayList(java.util.ArrayList) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) NetworkService(org.elasticsearch.common.network.NetworkService) Settings(org.elasticsearch.common.settings.Settings) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) After(org.junit.After) NettyBootstrap(io.crate.netty.NettyBootstrap) ThreadPool(org.elasticsearch.threadpool.ThreadPool) ESTestCase(org.elasticsearch.test.ESTestCase) MockTransportService(org.elasticsearch.test.transport.MockTransportService) Collections.emptyMap(java.util.Collections.emptyMap) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) AfterClass(org.junit.AfterClass) Collections.emptySet(java.util.Collections.emptySet) Netty4Transport(org.elasticsearch.transport.netty4.Netty4Transport) User(io.crate.user.User) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) IOException(java.io.IOException) PageCacheRecycler(org.elasticsearch.common.util.PageCacheRecycler) Test(org.junit.Test) VersionUtils(org.elasticsearch.test.VersionUtils) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) Version(org.elasticsearch.Version) SslContextProvider(io.crate.protocols.ssl.SslContextProvider) AlwaysOKAuthentication(io.crate.auth.AlwaysOKAuthentication) Matchers.containsString(org.hamcrest.Matchers.containsString) Collections(java.util.Collections) ActionListener(org.elasticsearch.action.ActionListener) AlwaysOKAuthentication(io.crate.auth.AlwaysOKAuthentication) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) MockTransportService(org.elasticsearch.test.transport.MockTransportService) Netty4Transport(org.elasticsearch.transport.netty4.Netty4Transport) MockTransportService(org.elasticsearch.test.transport.MockTransportService) NetworkService(org.elasticsearch.common.network.NetworkService) SslContextProvider(io.crate.protocols.ssl.SslContextProvider) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) NettyBootstrap(io.crate.netty.NettyBootstrap)

Aggregations

NamedWriteableRegistry (org.elasticsearch.common.io.stream.NamedWriteableRegistry)71 NetworkService (org.elasticsearch.common.network.NetworkService)27 NoneCircuitBreakerService (org.elasticsearch.indices.breaker.NoneCircuitBreakerService)25 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)23 Settings (org.elasticsearch.common.settings.Settings)21 ThreadPool (org.elasticsearch.threadpool.ThreadPool)19 ArrayList (java.util.ArrayList)18 MockTransportService (org.elasticsearch.test.transport.MockTransportService)18 Transport (org.elasticsearch.transport.Transport)18 IOException (java.io.IOException)15 Collections (java.util.Collections)15 TransportAddress (org.elasticsearch.common.transport.TransportAddress)15 BigArrays (org.elasticsearch.common.util.BigArrays)15 SearchModule (org.elasticsearch.search.SearchModule)15 TestThreadPool (org.elasticsearch.threadpool.TestThreadPool)15 MockTcpTransport (org.elasticsearch.transport.MockTcpTransport)15 NamedXContentRegistry (org.elasticsearch.common.xcontent.NamedXContentRegistry)14 TransportService (org.elasticsearch.transport.TransportService)14 List (java.util.List)13 ESTestCase (org.elasticsearch.test.ESTestCase)13