use of org.opensearch.common.network.NetworkService in project OpenSearch by opensearch-project.
the class Ec2NetworkTests method testNetworkHostCoreLocal.
/**
* Test that we don't have any regression with network host core settings such as
* network.host: _local_
*/
public void testNetworkHostCoreLocal() throws IOException {
NetworkService networkService = new NetworkService(Collections.singletonList(new Ec2NameResolver()));
InetAddress[] addresses = networkService.resolveBindHostAddresses(null);
assertThat(addresses, arrayContaining(networkService.resolveBindHostAddresses(new String[] { "_local_" })));
}
use of org.opensearch.common.network.NetworkService in project OpenSearch by opensearch-project.
the class GceDiscoveryTests method buildDynamicNodes.
protected List<TransportAddress> buildDynamicNodes(GceInstancesServiceImpl gceInstancesService, Settings nodeSettings) {
GceSeedHostsProvider provider = new GceSeedHostsProvider(nodeSettings, gceInstancesService, transportService, new NetworkService(Collections.emptyList()));
List<TransportAddress> dynamicHosts = provider.getSeedAddresses(null);
logger.info("--> addresses found: {}", dynamicHosts);
return dynamicHosts;
}
use of org.opensearch.common.network.NetworkService in project OpenSearch by opensearch-project.
the class Netty4SizeHeaderFrameDecoderTests method startThreadPool.
@Before
public void startThreadPool() {
threadPool = new ThreadPool(settings);
NetworkService networkService = new NetworkService(Collections.emptyList());
PageCacheRecycler recycler = new MockPageCacheRecycler(Settings.EMPTY);
nettyTransport = new Netty4Transport(settings, Version.CURRENT, threadPool, networkService, recycler, new NamedWriteableRegistry(Collections.emptyList()), new NoneCircuitBreakerService(), new SharedGroupFactory(settings));
nettyTransport.start();
TransportAddress[] boundAddresses = nettyTransport.boundAddress().boundAddresses();
TransportAddress transportAddress = randomFrom(boundAddresses);
port = transportAddress.address().getPort();
host = transportAddress.address().getAddress();
}
use of org.opensearch.common.network.NetworkService in project OpenSearch by opensearch-project.
the class NettyTransportMultiPortTests method startTransport.
private TcpTransport startTransport(Settings settings, ThreadPool threadPool) {
PageCacheRecycler recycler = new MockPageCacheRecycler(Settings.EMPTY);
TcpTransport transport = new Netty4Transport(settings, Version.CURRENT, threadPool, new NetworkService(Collections.emptyList()), recycler, new NamedWriteableRegistry(Collections.emptyList()), new NoneCircuitBreakerService(), new SharedGroupFactory(settings));
transport.start();
assertThat(transport.lifecycleState(), is(Lifecycle.State.STARTED));
return transport;
}
use of org.opensearch.common.network.NetworkService in project OpenSearch by opensearch-project.
the class Netty4HttpServerPipeliningTests method setup.
@Before
public void setup() throws Exception {
networkService = new NetworkService(Collections.emptyList());
threadPool = new TestThreadPool("test");
bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
}
Aggregations