diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2022-03-31 10:35:33 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2022-03-31 10:35:33 +0200 |
commit | 2353b584a69e14f97682ad90b3a492b1530abff2 (patch) | |
tree | be8cb398699c79a20d9015b6451f8bb5bf360613 /config-model | |
parent | 51368648e157524420ece2e1754acbe93e0c1eaf (diff) |
Move HostName -> Hostnames, and DomainName and Hostname to com.yahoo.net
Diffstat (limited to 'config-model')
10 files changed, 30 insertions, 30 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 c9a03dad65e..af1e94e14f2 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 @@ -3,7 +3,7 @@ package com.yahoo.config.model.provision; import com.google.common.collect.ImmutableMap; import com.yahoo.config.model.builder.xml.XmlHelper; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.text.XML; import com.yahoo.vespa.model.builder.xml.dom.VespaDomBuilder; import org.w3c.dom.Document; @@ -75,7 +75,7 @@ public class Hosts { throw new IllegalArgumentException("Missing 'name' attribute for host."); } if ("localhost".equals(name)) { - name = HostName.getLocalhost(); + name = Hostnames.getLocalhost(); } 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 c3b91c5da0f..d3a6ad9897f 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 @@ -9,7 +9,7 @@ import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.ProvisionLogger; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import java.util.ArrayList; import java.util.List; @@ -29,12 +29,12 @@ public class SingleNodeProvisioner implements HostProvisioner { private int counter = 0; public SingleNodeProvisioner() { - host = new Host(HostName.getLocalhost()); + host = new Host(Hostnames.getLocalhost()); this.hostSpec = new HostSpec(host.hostname(), host.aliases(), Optional.empty()); } public SingleNodeProvisioner(Flavor flavor) { - host = new Host(HostName.getLocalhost()); + host = new Host(Hostnames.getLocalhost()); this.hostSpec = new HostSpec(host.hostname(), flavor.resources(), flavor.resources(), flavor.resources(), ClusterMembership.from(ClusterSpec.specification(ClusterSpec.Type.content, ClusterSpec.Id.from("test")).group(ClusterSpec.Group.from(0)).vespaVersion("1").build(), 0), diff --git a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java index 6e63a1d9e68..640210717b9 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java @@ -9,7 +9,7 @@ import com.yahoo.config.provision.ClusterMembership; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.ProvisionLogger; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import java.net.UnknownHostException; import java.util.LinkedHashMap; @@ -78,7 +78,7 @@ public class HostSystem extends AbstractConfigProducer<Host> { HostResource hostResource = hostname2host.get(name); if (hostResource == null) { // Create a new HostResource if this is the host this code is running on (as it is when running tests) - if (HostName.getLocalhost().equals(name)) { + if (Hostnames.getLocalhost().equals(name)) { if (! getChildren().containsKey(localhost)) { new Host(this, localhost); } 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 413c6f07efd..6ad18e195a8 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 @@ -12,7 +12,7 @@ import com.yahoo.config.provision.Zone; import com.yahoo.container.StatisticsConfig; import com.yahoo.container.core.VipStatusConfig; import com.yahoo.container.jdisc.config.HealthMonitorConfig; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.model.container.ContainerCluster; import com.yahoo.vespa.model.container.configserver.option.CloudConfigOptions; @@ -66,7 +66,7 @@ public class ConfigserverCluster extends AbstractConfigProducer configServers.length, zookeeperIds.length)); } - String myhostname = HostName.getLocalhost(); + String myhostname = Hostnames.getLocalhost(); // TODO: Server index should be in interval [1, 254] according to doc, // however, we cannot change this id for an existing server for (int i = 0; i < configServers.length; i++) { @@ -120,7 +120,7 @@ public class ConfigserverCluster extends AbstractConfigProducer builder.environment(options.system().get()); } - builder.serverId(HostName.getLocalhost()); + builder.serverId(Hostnames.getLocalhost()); if (!containerCluster.getHttp().getHttpServer().get().getConnectorFactories().isEmpty()) { builder.httpport(containerCluster.getHttp().getHttpServer().get().getConnectorFactories().get(0).getListenPort()); } @@ -150,7 +150,7 @@ public class ConfigserverCluster extends AbstractConfigProducer private ConfigServer[] getConfigServers() { return Optional.of(options.allConfigServers()) .filter(configServers -> configServers.length > 0) - .orElseGet(() -> new ConfigServer[]{new ConfigServer(HostName.getLocalhost(), Optional.empty())}); + .orElseGet(() -> new ConfigServer[]{new ConfigServer(Hostnames.getLocalhost(), Optional.empty())}); } private int[] getConfigServerZookeeperIds() { 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 66cbfbd537f..9fea2cee88c 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 @@ -7,7 +7,7 @@ import com.yahoo.config.model.ConfigModel; import com.yahoo.config.model.ConfigModelRegistry; import com.yahoo.config.model.MapConfigModelRegistry; import com.yahoo.config.model.ApplicationConfigProducerRoot; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.vespa.model.ConfigProducer; import com.yahoo.vespa.model.HostResource; import com.yahoo.vespa.model.HostSystem; @@ -83,7 +83,7 @@ public class SystemModelTestCase { // Verify configIds from vespaModel assertTrue(12 <= vespaModel.getConfigIds().size()); - String localhost = HostName.getLocalhost(); + String localhost = Hostnames.getLocalhost(); 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 96f6c7999cc..e2c316a57c5 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 @@ -16,7 +16,7 @@ import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.Zone; import com.yahoo.container.StatisticsConfig; import com.yahoo.container.jdisc.config.HealthMonitorConfig; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.vespa.config.core.StateserverConfig; import com.yahoo.vespa.model.Service; import com.yahoo.vespa.model.VespaModel; @@ -60,7 +60,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = Hostnames.getLocalhost(); String localhostConfigId = "hosts/" + localhost; assertTrue(configIds.contains(localhostConfigId)); assertTrue(configIds.contains("admin/logserver")); @@ -124,7 +124,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = Hostnames.getLocalhost(); String localhostConfigId = "hosts/" + localhost; assertTrue(configIds.contains(localhostConfigId)); assertTrue(configIds.contains("admin/logserver")); @@ -164,7 +164,7 @@ public class AdminTestCase { .build())) .build(); TestRoot root = new TestDriver().buildModel(state); - String localhost = HostName.getLocalhost(); + String localhost = Hostnames.getLocalhost(); SentinelConfig config = root.getConfig(SentinelConfig.class, "hosts/" + localhost); assertEquals("quux", config.application().tenant()); assertEquals("foo", config.application().name()); @@ -187,7 +187,7 @@ public class AdminTestCase { // Verify configIds Set<String> configIds = vespaModel.getConfigIds(); - String localhost = HostName.getLocalhost(); + String localhost = Hostnames.getLocalhost(); 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/container/HostProvisionerWithCustomRealResource.java b/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java index e8f30d59aa9..e87388a0413 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java @@ -9,7 +9,7 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.ProvisionLogger; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import java.util.List; import java.util.Optional; @@ -26,7 +26,7 @@ public class HostProvisionerWithCustomRealResource implements HostProvisioner { @Override public HostSpec allocateHost(String alias) { - Host host = new Host(HostName.getLocalhost()); + Host host = new Host(Hostnames.getLocalhost()); ClusterMembership membership = ClusterMembership.from( ClusterSpec .specification( 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 29cff23d3bd..ecfade44f76 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 @@ -11,7 +11,7 @@ import com.yahoo.config.model.test.MockRoot; import com.yahoo.container.StatisticsConfig; import com.yahoo.container.di.config.PlatformBundlesConfig; import com.yahoo.container.jdisc.config.HealthMonitorConfig; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.text.XML; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.model.HostResource; @@ -108,7 +108,7 @@ public class ConfigserverClusterTest { assertEquals(Defaults.getDefaults().underVespaHome("lib/jars/config-models"), config.configModelPluginDir().get(0)); assertEquals(12345, config.rpcport()); assertEquals(1337, config.httpport()); - assertEquals(HostName.getLocalhost(), config.serverId()); + assertEquals(Hostnames.getLocalhost(), config.serverId()); assertTrue(config.useVespaVersionInRequest()); assertEquals(4, config.numParallelTenantLoaders()); assertFalse(config.multitenant()); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java index 16b4a8bed9b..04f1b418219 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java @@ -36,7 +36,7 @@ import com.yahoo.container.jdisc.JdiscBindingsConfig; import com.yahoo.container.jdisc.secretstore.SecretStoreConfig; import com.yahoo.container.usability.BindingsOverviewHandler; import com.yahoo.jdisc.http.ConnectorConfig; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.path.Path; import com.yahoo.prelude.cluster.QrMonitorConfig; import com.yahoo.search.config.QrStartConfig; @@ -645,7 +645,7 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase { @Test public void qrconfig_is_produced() throws IOException, SAXException { QrConfig qr = getQrConfig(new TestProperties()); - String hostname = HostName.getLocalhost(); // Using the same way of getting hostname as filedistribution model + String hostname = Hostnames.getLocalhost(); // Using the same way of getting hostname as filedistribution model assertEquals("default.container.0", qr.discriminator()); assertEquals(19102, qr.rpc().port()); assertEquals("vespa/service/default/container.0", qr.rpc().slobrokId()); 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 7f8bca825d2..b8fbe960dc9 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 @@ -22,7 +22,7 @@ import com.yahoo.config.provision.AllocatedHosts; import com.yahoo.config.provision.ApplicationId; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.messagebus.MessagebusConfig; -import com.yahoo.net.HostName; +import com.yahoo.net.Hostnames; import com.yahoo.vespa.config.UnknownConfigIdException; import com.yahoo.vespa.model.ConfigProducer; import com.yahoo.vespa.model.VespaModel; @@ -87,7 +87,7 @@ public class VespaModelTestCase { LogdConfig.Builder b = new LogdConfig.Builder(); b = (LogdConfig.Builder) model.getConfig(b, ""); LogdConfig c = new LogdConfig(b); - assertEquals(HostName.getLocalhost(), c.logserver().host()); + assertEquals(Hostnames.getLocalhost(), c.logserver().host()); SlobroksConfig.Builder sb = new SlobroksConfig.Builder(); sb = (com.yahoo.cloud.config.SlobroksConfig.Builder) model.getConfig(sb, ""); @@ -98,7 +98,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(HostName.getLocalhost())); + assertTrue(zc.zookeeperserverlist().startsWith(Hostnames.getLocalhost())); ApplicationIdConfig.Builder appIdBuilder = new ApplicationIdConfig.Builder(); appIdBuilder = (ApplicationIdConfig.Builder) model.getConfig(appIdBuilder, ""); @@ -112,11 +112,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(), Hostnames.getLocalhost()); assertNotNull(config); config = getLogdConfig(model, "hosts"); assertNotNull(config); - assertEquals(config.logserver().host(), HostName.getLocalhost()); + assertEquals(config.logserver().host(), Hostnames.getLocalhost()); } private static LogdConfig getLogdConfig(VespaModel model, String configId) { @@ -143,7 +143,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/" + Hostnames.getLocalhost() + "/logd"); assertNotNull(config); assertEquals(config.logserver().host(), "foo"); } |