diff options
author | Håkon Hallingstad <hakon@yahoo-inc.com> | 2016-10-13 14:46:26 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahoo-inc.com> | 2016-10-13 14:46:26 +0200 |
commit | b468510a654a7a0c35f5bd170a4df9c6d681333a (patch) | |
tree | 19fd34fe70383ed8a065ddb220687affcbcbb919 | |
parent | 1cf9b1ba204dd595cfd4a790aa173ac971ec7ec8 (diff) |
Rename getLocalhost to getHostName
24 files changed, 34 insertions, 39 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java b/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java index 6a5abee7cb3..fbd5e712d3d 100644 --- a/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java +++ b/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java @@ -2,7 +2,6 @@ package com.yahoo.config.model.provision; import com.google.common.collect.ImmutableMap; -import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.config.model.builder.xml.XmlHelper; import com.yahoo.net.HostName; import com.yahoo.text.XML; @@ -76,7 +75,7 @@ public class Hosts { throw new RuntimeException("Missing 'name' attribute for host."); } if ("localhost".equals(name)) { - name = HostName.getLocalhost(); + name = HostName.getHostName(); } final List<String> hostAliases = VespaDomBuilder.getHostAliases(hostE.getChildNodes()); if (hostAliases.isEmpty()) { diff --git a/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java b/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java index fe8b3935fcf..fb706e7201f 100644 --- a/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java +++ b/config-model/src/main/java/com/yahoo/config/model/provision/SingleNodeProvisioner.java @@ -26,7 +26,7 @@ public class SingleNodeProvisioner implements HostProvisioner { public SingleNodeProvisioner() { try { - host = new Host(HostSystem.lookupCanonicalHostname(HostName.getLocalhost())); + host = new Host(HostSystem.lookupCanonicalHostname(HostName.getHostName())); this.hostSpec = new HostSpec(host.hostname(), host.aliases()); } catch (UnknownHostException e) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/configserver/ConfigserverCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/configserver/ConfigserverCluster.java index ef0f4882f1c..96c80c57ab2 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/configserver/ConfigserverCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/configserver/ConfigserverCluster.java @@ -52,7 +52,7 @@ public class ConfigserverCluster extends AbstractConfigProducer @Override public void getConfig(ZookeeperServerConfig.Builder builder) { - String myhostname = HostName.getLocalhost(); + String myhostname = HostName.getHostName(); int myid = 0; int i = 0; for (ConfigServer server : getConfigServers()) { @@ -115,7 +115,7 @@ public class ConfigserverCluster extends AbstractConfigProducer builder.defaultContentFlavor(options.defaultContentFlavor().get()); } - builder.serverId(HostName.getLocalhost()); + builder.serverId(HostName.getHostName()); if (!containerCluster.getHttp().getHttpServer().getConnectorFactories().isEmpty()) { builder.httpport(containerCluster.getHttp().getHttpServer().getConnectorFactories().get(0).getListenPort()); } @@ -144,7 +144,7 @@ public class ConfigserverCluster extends AbstractConfigProducer if (options.allConfigServers().length > 0) { return options.allConfigServers(); } else { - return new ConfigServer[]{new ConfigServer(HostName.getLocalhost(), Optional.<Integer>empty()) }; + return new ConfigServer[]{new ConfigServer(HostName.getHostName(), Optional.<Integer>empty()) }; } } diff --git a/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java b/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java index 6be85fb19e4..dc0ace32c1b 100644 --- a/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java +++ b/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java @@ -78,7 +78,7 @@ public class SystemModelTestCase { // Verify configIds from vespaModel assertTrue(12 <= vespaModel.getConfigIds().size()); - String localhost = HostName.getLocalhost(); + String localhost = HostName.getHostName(); String localhostConfigId = "hosts/" + localhost; Set<String> configIds = vespaModel.getConfigIds(); assertTrue(configIds.contains("client")); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java index a8554c54867..f203fbce328 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java @@ -8,7 +8,6 @@ import com.yahoo.cloud.config.SentinelConfig; import com.yahoo.config.model.ApplicationConfigProducerRoot; import com.yahoo.config.model.deploy.DeployProperties; import com.yahoo.config.model.deploy.DeployState; -import com.yahoo.config.model.test.MockApplicationPackage; import com.yahoo.config.model.test.TestDriver; import com.yahoo.config.model.test.TestRoot; import com.yahoo.config.provision.ApplicationId; @@ -24,10 +23,7 @@ import com.yahoo.vespa.model.container.component.Component; import com.yahoo.vespa.model.container.component.StatisticsComponent; import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg; import org.junit.Test; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.util.List; import java.util.Set; import static org.hamcrest.CoreMatchers.is; @@ -65,7 +61,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = HostName.getHostName(); String localhostConfigId = "hosts/" + localhost; assertTrue(configIds.contains(localhostConfigId)); assertTrue(configIds.contains("admin/logserver")); @@ -119,7 +115,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = HostName.getHostName(); String localhostConfigId = "hosts/" + localhost; assertTrue(configIds.contains(localhostConfigId)); assertTrue(configIds.contains("admin/logserver")); @@ -156,7 +152,7 @@ public class AdminTestCase { tenant("quux"). applicationName("foo").instanceName("bim").build()).build()).build(); TestRoot root = new TestDriver().buildModel(state); - String localhost = HostName.getLocalhost(); + String localhost = HostName.getHostName(); SentinelConfig config = root.getConfig(SentinelConfig.class, "hosts/" + localhost); assertThat(config.application().tenant(), is("quux")); assertThat(config.application().name(), is("foo")); @@ -179,7 +175,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = HostName.getHostName(); String localhostConfigId = "hosts/" + localhost; assertTrue(configIds.contains(localhostConfigId)); assertTrue(configIds.contains("admin/logserver")); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/clients/test/Gateway20TestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/clients/test/Gateway20TestCase.java index 5987ab8410a..579abf6d2c6 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/clients/test/Gateway20TestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/clients/test/Gateway20TestCase.java @@ -21,7 +21,7 @@ import static org.junit.Assert.*; * @author <a href="mailto:gunnarga@yahoo-inc.com">Gunnar Gauslaa Bergem</a> */ public class Gateway20TestCase { - private static String hostname = HostName.getLocalhost(); // Using the same way of getting hostname as filedistribution model + private static String hostname = HostName.getHostName(); // Using the same way of getting hostname as filedistribution model @Test public void testSimpleDocprocV3() throws Exception { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java index 170586bef85..d9fc3cd9007 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java @@ -71,7 +71,7 @@ public class ConfigserverClusterTest { assertThat(config.configModelPluginDir().get(0), is(Defaults.getDefaults().vespaHome() + "lib/jars/config-models")); assertThat(config.rpcport(), is(12345)); assertThat(config.httpport(), is(1337)); - assertThat(config.serverId(), is(HostName.getLocalhost())); + assertThat(config.serverId(), is(HostName.getHostName())); assertTrue(config.useVespaVersionInRequest()); assertThat(config.numParallelTenantLoaders(), is(4)); assertFalse(config.multitenant()); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java index 8eca2bb52ce..5bb01c87d0f 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java @@ -101,7 +101,7 @@ public class VespaModelTestCase { LogdConfig.Builder b = new LogdConfig.Builder(); b = (LogdConfig.Builder) model.getConfig(b, ""); LogdConfig c = new LogdConfig(b); - assertEquals(HostSystem.lookupCanonicalHostname(HostName.getLocalhost()), c.logserver().host()); + assertEquals(HostSystem.lookupCanonicalHostname(HostName.getHostName()), c.logserver().host()); SlobroksConfig.Builder sb = new SlobroksConfig.Builder(); sb = (com.yahoo.cloud.config.SlobroksConfig.Builder) model.getConfig(sb, ""); @@ -112,7 +112,7 @@ public class VespaModelTestCase { zb = (ZookeepersConfig.Builder) model.getConfig(zb, ""); ZookeepersConfig zc = new ZookeepersConfig(zb); assertEquals(zc.zookeeperserverlist().split(",").length, 2); - assertTrue(zc.zookeeperserverlist().startsWith(HostSystem.lookupCanonicalHostname(HostName.getLocalhost()))); + assertTrue(zc.zookeeperserverlist().startsWith(HostSystem.lookupCanonicalHostname(HostName.getHostName()))); ApplicationIdConfig.Builder appIdBuilder = new ApplicationIdConfig.Builder(); appIdBuilder = (ApplicationIdConfig.Builder) model.getConfig(appIdBuilder, ""); @@ -126,11 +126,11 @@ public class VespaModelTestCase { public void testHostsConfig() { VespaModel model = getVespaModel(TESTDIR + "app_qrserverandgw"); LogdConfig config = getLogdConfig(model, ""); - assertEquals(config.logserver().host(), HostName.getLocalhost()); + assertEquals(config.logserver().host(), HostName.getHostName()); assertNotNull(config); config = getLogdConfig(model, "hosts"); assertNotNull(config); - assertEquals(config.logserver().host(), HostName.getLocalhost()); + assertEquals(config.logserver().host(), HostName.getHostName()); } private static LogdConfig getLogdConfig(VespaModel model, String configId) { @@ -157,7 +157,7 @@ public class VespaModelTestCase { LogdConfig config = getLogdConfig(model, ""); assertNotNull(config); assertEquals(config.logserver().host(), "foo"); - config = getLogdConfig(model, "hosts/" + HostName.getLocalhost() + "/logd"); + config = getLogdConfig(model, "hosts/" + HostName.getHostName() + "/logd"); assertNotNull(config); assertEquals(config.logserver().host(), "foo"); } diff --git a/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java b/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java index 52df1cff117..b1eb05fa76b 100644 --- a/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java +++ b/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java @@ -424,7 +424,7 @@ public class ConfigUtils { } public static String getCanonicalHostName() { - return HostName.getLocalhost(); + return HostName.getHostName(); } /** diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java index 37cea22e420..307a0163331 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java @@ -35,7 +35,7 @@ public class FileDBRegistry implements FileRegistry { @Override public String fileSourceHost() { - return HostName.getLocalhost(); + return HostName.getHostName(); } @Override diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java index 310c7ceeef7..6d9e1a9e6c1 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java @@ -27,7 +27,7 @@ import java.util.logging.Logger; class GetConfigProcessor implements Runnable { private static final Logger log = Logger.getLogger(GetConfigProcessor.class.getName()); - private static final String localHostName = HostName.getLocalhost(); + private static final String localHostName = HostName.getHostName(); private final JRTServerConfigRequest request; /* True only when this request has expired its server timeout and we need to respond to the client */ diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java index 8f1754357b2..4348b587596 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; public class TestWithRpc { private final ManualClock clock = new ManualClock(Instant.ofEpochMilli(100)); - private final String myHostname = HostName.getLocalhost(); + private final String myHostname = HostName.getHostName(); private final HostLivenessTracker hostLivenessTracker = new ConfigRequestHostLivenessTracker(clock); protected RpcServer rpcServer; diff --git a/container-core/src/main/java/com/yahoo/container/osgi/ContainerRpcAdaptor.java b/container-core/src/main/java/com/yahoo/container/osgi/ContainerRpcAdaptor.java index 8b0ed41cd8c..3906e3a57ff 100644 --- a/container-core/src/main/java/com/yahoo/container/osgi/ContainerRpcAdaptor.java +++ b/container-core/src/main/java/com/yahoo/container/osgi/ContainerRpcAdaptor.java @@ -43,7 +43,7 @@ public class ContainerRpcAdaptor extends AbstractRpcAdaptor { public ContainerRpcAdaptor(Osgi osgi) { this.osgi = osgi; this.supervisor = new Supervisor(new Transport()); - this.hostname = HostName.getLocalhost(); + this.hostname = HostName.getHostName(); bindCommands(supervisor); } 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 36ae057b418..c7829dfde7f 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.getLocalhost()); + return !host.equals(HostName.getHostName()); } 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 504c5dd363a..ee059edb519 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.getLocalhost(); + this.selfHostname = HostName.getHostName(); } 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 b6ee70802d8..c1a07759718 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.getLocalhost(), size, containerClusterSize, + this.directDispatchTarget = findDirectDispatchTarget(HostName.getHostName(), size, containerClusterSize, nodesByHost, groups); // Set up monitoring of the fs4 interface of the nodes 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 d2638be4bc7..93b18da215a 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.getLocalhost(); + public static final String selfHostname = HostName.getHostName(); private final MockFS4ResourcePool mockFS4ResourcePool; private final FastSearcher fastSearcher; diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java index 5e5185bc6be..c0ffe367259 100644 --- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java +++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java @@ -124,7 +124,7 @@ public class DockerImpl implements Docker { if (! dockerClient.listNetworksCmd().withNameFilter(DOCKER_CUSTOM_MACVLAN_NETWORK_NAME).exec().isEmpty()) return; // Use IPv6 address if there is a mix of IP4 and IPv6 by taking the longest address. - List<InetAddress> hostAddresses = Arrays.asList(InetAddress.getAllByName(com.yahoo.net.HostName.getLocalhost())); + List<InetAddress> hostAddresses = Arrays.asList(InetAddress.getAllByName(com.yahoo.net.HostName.getHostName())); InetAddress hostAddress = Collections.max(hostAddresses, (o1, o2) -> o1.getAddress().length - o2.getAddress().length); @@ -563,7 +563,7 @@ public class DockerImpl implements Docker { private void setMetrics(MetricReceiverWrapper metricReceiver) { Dimensions dimensions = new Dimensions.Builder() - .add("host", HostName.getLocalhost()) + .add("host", HostName.getHostName()) .add("role", "docker").build(); numberOfRunningContainersGauge = metricReceiver.declareGauge(dimensions, "containers.running"); diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java b/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java index 585fe680ba9..a10cd4b8a63 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java @@ -23,7 +23,7 @@ public class Identity { * @param configId The config identifier for the application. */ public Identity(String configId) { - hostname = HostName.getLocalhost(); // ... but fallback to hostname if we get an IPv6 address + hostname = HostName.getHostName(); // ... but fallback to hostname if we get an IPv6 address servicePrefix = configId; } diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java index 15a33dddd3c..b86a3c11f70 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java @@ -75,7 +75,7 @@ public class NodeAdminImpl implements NodeAdmin { this.nodeAgentScanIntervalMillis = nodeAgentScanIntervalMillis; Dimensions dimensions = new Dimensions.Builder() - .add("host", HostName.getLocalhost()) + .add("host", HostName.getHostName()) .add("role", "docker").build(); this.numberOfContainersInActiveState = metricReceiver.declareGauge(dimensions, "nodes.state.active"); diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/LocalFileDb.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/LocalFileDb.scala index 7af08a4685d..b1c7e9457ac 100644 --- a/standalone-container/src/main/scala/com/yahoo/container/standalone/LocalFileDb.scala +++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/LocalFileDb.scala @@ -49,7 +49,7 @@ class LocalFileDb(appPath: Path) extends FileAcquirer with FileRegistry { } def fileSourceHost: String = - HostName.getLocalhost + HostName.getHostName def allRelativePaths: java.util.Set[String] = { new java.util.HashSet(fileReferenceToFile.values.map(_.getPath)) diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedHandler.java index c37cb51d7ca..78b33abedda 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedHandler.java @@ -270,7 +270,7 @@ public class FeedHandler extends LoggingRequestHandler { } private static String resolveLocalHostname() { - String hostname = HostName.getLocalhost(); + String hostname = HostName.getHostName(); if (hostname.equals("localhost")) { return ""; } diff --git a/vespajlib/src/main/java/com/yahoo/net/HostName.java b/vespajlib/src/main/java/com/yahoo/net/HostName.java index 21f8c8ede04..b65e61a7158 100644 --- a/vespajlib/src/main/java/com/yahoo/net/HostName.java +++ b/vespajlib/src/main/java/com/yahoo/net/HostName.java @@ -35,7 +35,7 @@ public class HostName { * @return the name of localhost. * @throws RuntimeException if executing the command 'hostname' fails. */ - public static synchronized String getLocalhost() { + public static synchronized String getHostName() { if (cachedHostName == null) { try { Address preferredAddress = getPreferredAddress(); diff --git a/vespajlib/src/test/java/com/yahoo/net/HostNameTestCase.java b/vespajlib/src/test/java/com/yahoo/net/HostNameTestCase.java index bcb766d6cb8..a993b67a59e 100644 --- a/vespajlib/src/test/java/com/yahoo/net/HostNameTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/net/HostNameTestCase.java @@ -11,7 +11,7 @@ import static org.junit.Assert.assertFalse; public class HostNameTestCase { @Test public void testHostnameIsFound() { - assertFalse(HostName.getLocalhost().isEmpty()); + assertFalse(HostName.getHostName().isEmpty()); } @Test |