|
|
@@ -38,6 +38,7 @@ import org.elasticsearch.common.transport.BoundTransportAddress;
|
|
|
import org.elasticsearch.common.transport.TransportAddress;
|
|
|
import org.elasticsearch.common.unit.TimeValue;
|
|
|
import org.elasticsearch.common.util.BigArrays;
|
|
|
+import org.elasticsearch.common.util.PageCacheRecycler;
|
|
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
|
|
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
|
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
|
|
@@ -56,6 +57,7 @@ import org.elasticsearch.transport.TransportException;
|
|
|
import org.elasticsearch.transport.TransportRequestOptions;
|
|
|
import org.elasticsearch.transport.TransportResponseHandler;
|
|
|
import org.elasticsearch.transport.TransportService;
|
|
|
+import org.elasticsearch.transport.nio.MockNioTransport;
|
|
|
import org.junit.After;
|
|
|
import org.junit.Before;
|
|
|
import org.mockito.Matchers;
|
|
|
@@ -143,14 +145,14 @@ public class UnicastZenPingTests extends ESTestCase {
|
|
|
|
|
|
NetworkService networkService = new NetworkService(Collections.emptyList());
|
|
|
|
|
|
- final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockTcpTransport(
|
|
|
+ final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockNioTransport(
|
|
|
s,
|
|
|
+ v,
|
|
|
threadPool,
|
|
|
- BigArrays.NON_RECYCLING_INSTANCE,
|
|
|
- new NoneCircuitBreakerService(),
|
|
|
- new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
networkService,
|
|
|
- v);
|
|
|
+ PageCacheRecycler.NON_RECYCLING_INSTANCE,
|
|
|
+ new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
+ new NoneCircuitBreakerService());
|
|
|
|
|
|
NetworkHandle handleA = startServices(settings, threadPool, "UZP_A", Version.CURRENT, supplier);
|
|
|
closeables.push(handleA.transportService);
|
|
|
@@ -268,14 +270,14 @@ public class UnicastZenPingTests extends ESTestCase {
|
|
|
final NetworkService networkService = new NetworkService(Collections.emptyList());
|
|
|
|
|
|
final Map<String, TransportAddress[]> addresses = new HashMap<>();
|
|
|
- final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockTcpTransport(
|
|
|
+ final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockNioTransport(
|
|
|
s,
|
|
|
+ v,
|
|
|
threadPool,
|
|
|
- BigArrays.NON_RECYCLING_INSTANCE,
|
|
|
- new NoneCircuitBreakerService(),
|
|
|
- new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
networkService,
|
|
|
- v) {
|
|
|
+ PageCacheRecycler.NON_RECYCLING_INSTANCE,
|
|
|
+ new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
+ new NoneCircuitBreakerService()) {
|
|
|
@Override
|
|
|
public TransportAddress[] addressesFromString(String address, int perAddressLimit) throws UnknownHostException {
|
|
|
final TransportAddress[] transportAddresses = addresses.get(address);
|
|
|
@@ -634,14 +636,14 @@ public class UnicastZenPingTests extends ESTestCase {
|
|
|
|
|
|
NetworkService networkService = new NetworkService(Collections.emptyList());
|
|
|
|
|
|
- final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockTcpTransport(
|
|
|
+ final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockNioTransport(
|
|
|
s,
|
|
|
+ v,
|
|
|
threadPool,
|
|
|
- BigArrays.NON_RECYCLING_INSTANCE,
|
|
|
- new NoneCircuitBreakerService(),
|
|
|
- new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
networkService,
|
|
|
- v);
|
|
|
+ PageCacheRecycler.NON_RECYCLING_INSTANCE,
|
|
|
+ new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
+ new NoneCircuitBreakerService());
|
|
|
|
|
|
NetworkHandle handleA = startServices(settings, threadPool, "UZP_A", Version.CURRENT, supplier, EnumSet.allOf(Role.class));
|
|
|
closeables.push(handleA.transportService);
|
|
|
@@ -689,15 +691,14 @@ public class UnicastZenPingTests extends ESTestCase {
|
|
|
|
|
|
public void testInvalidHosts() throws InterruptedException {
|
|
|
final Logger logger = mock(Logger.class);
|
|
|
- final NetworkService networkService = new NetworkService(Collections.emptyList());
|
|
|
- final Transport transport = new MockTcpTransport(
|
|
|
+ final Transport transport = new MockNioTransport(
|
|
|
Settings.EMPTY,
|
|
|
+ Version.CURRENT,
|
|
|
threadPool,
|
|
|
- BigArrays.NON_RECYCLING_INSTANCE,
|
|
|
- new NoneCircuitBreakerService(),
|
|
|
+ new NetworkService(Collections.emptyList()),
|
|
|
+ PageCacheRecycler.NON_RECYCLING_INSTANCE,
|
|
|
new NamedWriteableRegistry(Collections.emptyList()),
|
|
|
- networkService,
|
|
|
- Version.CURRENT) {
|
|
|
+ new NoneCircuitBreakerService()) {
|
|
|
@Override
|
|
|
public BoundTransportAddress boundAddress() {
|
|
|
return new BoundTransportAddress(
|