aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java2
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java2
-rw-r--r--container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java34
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTester.java2
5 files changed, 23 insertions, 19 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
index c7829dfde7f..36ae057b418 100644
--- a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
+++ b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
@@ -192,7 +192,7 @@ public class ClusterSearcher extends Searcher {
if (InetAddress.getByName(host).isLoopbackAddress())
return false;
else
- return !host.equals(HostName.getHostName());
+ return !host.equals(HostName.getLocalhost());
}
private static ClusterParams makeClusterParams(int searchclusterIndex,
diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java
index ee059edb519..504c5dd363a 100644
--- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java
+++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java
@@ -94,7 +94,7 @@ public class FastSearcher extends VespaBackEndSearcher {
this.dispatchBackend = dispatchBackend;
this.fs4ResourcePool = fs4ResourcePool;
this.dispatcher = dispatcher;
- this.selfHostname = HostName.getHostName();
+ this.selfHostname = HostName.getLocalhost();
}
private static SimpleDateFormat isoDateFormat;
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java b/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
index c1a07759718..b6ee70802d8 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
@@ -91,7 +91,7 @@ public class SearchCluster implements NodeManager<SearchCluster.Node> {
nodesByHostBuilder.put(node.hostname(), node);
this.nodesByHost = nodesByHostBuilder.build();
- this.directDispatchTarget = findDirectDispatchTarget(HostName.getHostName(), size, containerClusterSize,
+ this.directDispatchTarget = findDirectDispatchTarget(HostName.getLocalhost(), size, containerClusterSize,
nodesByHost, groups);
// Set up monitoring of the fs4 interface of the nodes
diff --git a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java
index f9c14a81d13..52a66fa6db9 100644
--- a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java
+++ b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java
@@ -1,18 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.fs4.mplex;
-import com.yahoo.container.search.Fs4Config;
-import com.yahoo.fs4.BasicPacket;
-import com.yahoo.fs4.ChannelTimeoutException;
-import com.yahoo.fs4.PacketListener;
-import com.yahoo.fs4.PingPacket;
-import com.yahoo.fs4.QueryPacket;
-import com.yahoo.fs4.mplex.Backend.BackendStatistics;
-import com.yahoo.prelude.fastsearch.FS4ResourcePool;
-import com.yahoo.search.Query;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.io.IOException;
import java.net.InetAddress;
@@ -22,9 +13,21 @@ import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.logging.Logger;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import com.yahoo.container.search.Fs4Config;
+import com.yahoo.net.HostName;
+import com.yahoo.net.LinuxInetAddress;
+import com.yahoo.prelude.fastsearch.FS4ResourcePool;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.yahoo.fs4.BasicPacket;
+import com.yahoo.fs4.ChannelTimeoutException;
+import com.yahoo.fs4.PacketListener;
+import com.yahoo.fs4.PingPacket;
+import com.yahoo.fs4.QueryPacket;
+import com.yahoo.fs4.mplex.Backend.BackendStatistics;
+import com.yahoo.search.Query;
/**
* Test networking code for talking to dispatch.
@@ -111,6 +114,7 @@ public class BackendTestCase {
public MockServer() throws IOException {
ServerSocket socket = new ServerSocket(0, 50, InetAddress.getLoopbackAddress());
+ //ServerSocket socket = new ServerSocket(0, 50, LinuxInetAddress.getLocalHost());
host = (InetSocketAddress) socket.getLocalSocketAddress();
dispatch = new MockDispatch(socket);
worker = new Thread(dispatch);
diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTester.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTester.java
index 93b18da215a..d2638be4bc7 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTester.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTester.java
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertEquals;
*/
class FastSearcherTester {
- public static final String selfHostname = HostName.getHostName();
+ public static final String selfHostname = HostName.getLocalhost();
private final MockFS4ResourcePool mockFS4ResourcePool;
private final FastSearcher fastSearcher;