summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java4
-rw-r--r--node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java2
-rw-r--r--node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/Maintainer.java2
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java4
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigInstallVariables.scala91
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigYinstVariables.scala91
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/Environment.scala6
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala14
-rw-r--r--standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.scala (renamed from standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigYinstVariablesTest.scala)4
-rw-r--r--standalone-container/src/test/scala/com/yahoo/container/standalone/StandaloneContainer.scala2
10 files changed, 110 insertions, 110 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index 81fc464327e..ac49ec53cbf 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -85,7 +85,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
/**
* Path to vip status file for container in Hosted Vespa. Only used if set, else use HOSTED_VESPA_STATUS_FILE
*/
- static final String HOSTED_VESPA_STATUS_FILE_YINST_SETTING = "cloudconfig_server__tenant_vip_status_file";
+ static final String HOSTED_VESPA_STATUS_FILE_INSTALL_SETTING = "cloudconfig_server__tenant_vip_status_file";
public enum Networking { disable, enable }
@@ -242,7 +242,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
protected void addStatusHandlers(ContainerCluster cluster, ConfigModelContext configModelContext) {
if (configModelContext.getDeployState().isHosted()) {
String name = "status.html";
- Optional<String> statusFile = Optional.ofNullable(System.getenv(HOSTED_VESPA_STATUS_FILE_YINST_SETTING));
+ Optional<String> statusFile = Optional.ofNullable(System.getenv(HOSTED_VESPA_STATUS_FILE_INSTALL_SETTING));
cluster.addComponent(
new FileStatusHandlerComponent(name + "-status-handler", statusFile.orElse(HOSTED_VESPA_STATUS_FILE),
"http://*/" + name, "https://*/" + name));
diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
index de08bdbe107..c82f4406015 100644
--- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
+++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollector.java
@@ -127,7 +127,7 @@ public class CoreCollector {
installStatePath.ifPresent(installState -> {
try {
- data.put("yinst_state", readInstallState(installState));
+ data.put("install_state", readInstallState(installState));
} catch (Exception e) {
logger.log(Level.WARNING, "Failed to read install state", e);
}
diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/Maintainer.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/Maintainer.java
index 1e95ca15c3d..6c8388c3f28 100644
--- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/Maintainer.java
+++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/maintainer/Maintainer.java
@@ -142,7 +142,7 @@ public class Maintainer {
Path coredumpsPath = Paths.get(getFieldOrFail(arguments, "coredumpsPath").asString());
Path doneCoredumpsPath = Paths.get(getFieldOrFail(arguments, "doneCoredumpsPath").asString());
Map<String, Object> attributesMap = parseMap(arguments);
- Optional<Path> installStatePath = SlimeUtils.optionalString(arguments.field("yinstStatePath")).map(Paths::get);
+ Optional<Path> installStatePath = SlimeUtils.optionalString(arguments.field("installStatePath")).map(Paths::get);
String feedEndpoint = getFieldOrFail(arguments, "feedEndpoint").asString();
try {
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
index 869b53dc7a7..4b58c16bdc3 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/maintainer/CoreCollectorTest.java
@@ -160,7 +160,7 @@ public class CoreCollectorTest {
expectedData.put("bin_path", TEST_BIN_PATH.toString());
expectedData.put("backtrace", new ArrayList<>(GDB_BACKTRACE));
expectedData.put("backtrace_all_threads", new ArrayList<>(GDB_BACKTRACE));
- expectedData.put("yinst_state", new ArrayList<>(INSTALL_STATE));
+ expectedData.put("install_state", new ArrayList<>(INSTALL_STATE));
expectedData.put("rpm_packages", new ArrayList<>(RPM_PACKAGES));
assertEquals(expectedData, coreCollector.collect(TEST_CORE_PATH, Optional.of(INSTALL_STATE_PATH)));
}
@@ -171,7 +171,7 @@ public class CoreCollectorTest {
mockExec(new String[]{"cat", INSTALL_STATE_PATH.toString()}, String.join("\n", INSTALL_STATE));
Map<String, Object> expectedData = new HashMap<>();
- expectedData.put("yinst_state", new ArrayList<>(INSTALL_STATE));
+ expectedData.put("install_state", new ArrayList<>(INSTALL_STATE));
assertEquals(expectedData, coreCollector.collect(TEST_CORE_PATH, Optional.of(INSTALL_STATE_PATH)));
}
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigInstallVariables.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigInstallVariables.scala
new file mode 100644
index 00000000000..8cfa01937c9
--- /dev/null
+++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigInstallVariables.scala
@@ -0,0 +1,91 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.container.standalone
+
+import java.util.Optional
+
+import com.yahoo.vespa.model.container.configserver.option.CloudConfigOptions
+import com.yahoo.vespa.model.container.configserver.option.CloudConfigOptions.ConfigServer
+
+import scala.language.implicitConversions
+import scala.util.Try
+
+/**
+ * @author Tony Vaagenes
+ */
+class CloudConfigInstallVariables extends CloudConfigOptions {
+ import CloudConfigInstallVariables._
+
+ override val rpcPort = optionalInstallVar[Integer]("port_configserver_rpc", "services")
+ override val allConfigServers = installVar("addr_configserver", "services") withDefault Array[ConfigServer]()
+ override val multiTenant = optionalInstallVar[java.lang.Boolean]("multitenant")
+
+ override val zookeeperBarrierTimeout = optionalInstallVar[java.lang.Long]("zookeeper_barrier_timeout")
+ override val sessionLifeTimeSecs = optionalInstallVar[java.lang.Long]("session_lifetime")
+ override val configModelPluginDirs = installVar("config_model_plugin_dirs") withDefault Array[String]()
+ override val zookeeperClientPort = optionalInstallVar[Integer]("zookeeper_clientPort")
+ override val zookeeperQuorumPort = optionalInstallVar[Integer]("zookeeper_quoromPort")
+ override val zookeeperElectionPort = optionalInstallVar[Integer]("zookeeper_electionPort")
+ override val payloadCompressionType = optionalInstallVar[java.lang.String]("payload_compression_type")
+ override val environment = optionalInstallVar[java.lang.String]("environment")
+ override val region = optionalInstallVar[java.lang.String]("region")
+ override val system = optionalInstallVar[java.lang.String]("system")
+ override val defaultFlavor = optionalInstallVar[java.lang.String]("default_flavor")
+ override val defaultAdminFlavor = optionalInstallVar[java.lang.String]("default_admin_flavor")
+ override val defaultContainerFlavor = optionalInstallVar[java.lang.String]("default_container_flavor")
+ override val defaultContentFlavor = optionalInstallVar[java.lang.String]("default_content_flavor")
+ override val useVespaVersionInRequest = optionalInstallVar[java.lang.Boolean]("use_vespa_version_in_request")
+ override val hostedVespa = optionalInstallVar[java.lang.Boolean]("hosted_vespa")
+ override val numParallelTenantLoaders = optionalInstallVar[java.lang.Integer]("num_parallel_tenant_loaders")
+ override val dockerRegistry = optionalInstallVar[java.lang.String]("docker_registry")
+ override val dockerVespaBaseImage = optionalInstallVar[java.lang.String]("docker_vespa_base_image")
+ override val loadBalancerAddress = optionalInstallVar[java.lang.String]("load_balancer_address")
+}
+
+object CloudConfigInstallVariables {
+ private class InstallVariable(installPkg:String, name: String) {
+ val value = Environment.optionalInstallVariable(installPkg + "." + name)
+
+ def withDefault[T](defaultValue: T)(implicit c: Converter[T]) : T = {
+ value map { implicitly[Converter[T]].convert } getOrElse defaultValue
+ }
+ }
+
+ private def installVar(setting:String, installPkg: String = "cloudconfig_server") = new InstallVariable(installPkg, setting)
+
+ private def optionalInstallVar[T](setting:String, installPkg: String = "cloudconfig_server")(implicit c: Converter[T]): Optional[T] = {
+ Environment.optionalInstallVariable(installPkg + "." + setting) map ( c.convert )
+ }
+
+ implicit val configServerConverter: Converter[Array[ConfigServer]] = new Converter[Array[ConfigServer]] {
+ override def convert(s: String) = {
+ s split "[, ]" filter { !_.isEmpty } map { toConfigServer }
+ }
+ }
+
+ implicit val stringArrayConverter: Converter[Array[String]] = new Converter[Array[String]] {
+ override def convert(s: String) = {
+ s split "[, ]" filter { !_.isEmpty }
+ }
+ }
+
+ private def toConfigServer(hostPort: String): ConfigServer = Try {
+ val (host, portStr) = splitFirst(hostPort, ':')
+ val port = portStr map { _.toInt }
+ new ConfigServer(host, port)
+ }.getOrElse(throw new IllegalArgumentException(s"Invalid config server '$hostPort'"))
+
+ private def splitFirst(string: String, separator: Character): (String, Option[String]) = {
+ val (beginning, endWithSeparator) = string span { _ != separator }
+ (beginning, tailOption(endWithSeparator))
+ }
+
+ def tailOption(s: String) = {
+ if (s.isEmpty) None
+ else Some(s.tail)
+ }
+
+ implicit def toJavaOptional[U <% V, V](option: Option[U]): Optional[V] = option match {
+ case Some(u) => Optional.of(u: V)
+ case None => Optional.empty()
+ }
+}
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigYinstVariables.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigYinstVariables.scala
deleted file mode 100644
index 436c1923319..00000000000
--- a/standalone-container/src/main/scala/com/yahoo/container/standalone/CloudConfigYinstVariables.scala
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.container.standalone
-
-import java.util.Optional
-
-import com.yahoo.vespa.model.container.configserver.option.CloudConfigOptions
-import com.yahoo.vespa.model.container.configserver.option.CloudConfigOptions.ConfigServer
-
-import scala.language.implicitConversions
-import scala.util.Try
-
-/**
- * @author Tony Vaagenes
- */
-class CloudConfigYinstVariables extends CloudConfigOptions {
- import CloudConfigYinstVariables._
-
- override val rpcPort = optionalYinstVar[Integer]("port_configserver_rpc", "services")
- override val allConfigServers = yinstVar("addr_configserver", "services") withDefault Array[ConfigServer]()
- override val multiTenant = optionalYinstVar[java.lang.Boolean]("multitenant")
-
- override val zookeeperBarrierTimeout = optionalYinstVar[java.lang.Long]("zookeeper_barrier_timeout")
- override val sessionLifeTimeSecs = optionalYinstVar[java.lang.Long]("session_lifetime")
- override val configModelPluginDirs = yinstVar("config_model_plugin_dirs") withDefault Array[String]()
- override val zookeeperClientPort = optionalYinstVar[Integer]("zookeeper_clientPort")
- override val zookeeperQuorumPort = optionalYinstVar[Integer]("zookeeper_quoromPort")
- override val zookeeperElectionPort = optionalYinstVar[Integer]("zookeeper_electionPort")
- override val payloadCompressionType = optionalYinstVar[java.lang.String]("payload_compression_type")
- override val environment = optionalYinstVar[java.lang.String]("environment")
- override val region = optionalYinstVar[java.lang.String]("region")
- override val system = optionalYinstVar[java.lang.String]("system")
- override val defaultFlavor = optionalYinstVar[java.lang.String]("default_flavor")
- override val defaultAdminFlavor = optionalYinstVar[java.lang.String]("default_admin_flavor")
- override val defaultContainerFlavor = optionalYinstVar[java.lang.String]("default_container_flavor")
- override val defaultContentFlavor = optionalYinstVar[java.lang.String]("default_content_flavor")
- override val useVespaVersionInRequest = optionalYinstVar[java.lang.Boolean]("use_vespa_version_in_request")
- override val hostedVespa = optionalYinstVar[java.lang.Boolean]("hosted_vespa")
- override val numParallelTenantLoaders = optionalYinstVar[java.lang.Integer]("num_parallel_tenant_loaders")
- override val dockerRegistry = optionalYinstVar[java.lang.String]("docker_registry")
- override val dockerVespaBaseImage = optionalYinstVar[java.lang.String]("docker_vespa_base_image")
- override val loadBalancerAddress = optionalYinstVar[java.lang.String]("load_balancer_address")
-}
-
-object CloudConfigYinstVariables {
- private class YinstVariable(yinstPkg:String, name: String) {
- val value = Environment.optionalYinstVariable(yinstPkg + "." + name)
-
- def withDefault[T](defaultValue: T)(implicit c: Converter[T]) : T = {
- value map { implicitly[Converter[T]].convert } getOrElse defaultValue
- }
- }
-
- private def yinstVar(setting:String, yinstPkg: String = "cloudconfig_server") = new YinstVariable(yinstPkg, setting)
-
- private def optionalYinstVar[T](setting:String, yinstPkg: String = "cloudconfig_server")(implicit c: Converter[T]): Optional[T] = {
- Environment.optionalYinstVariable(yinstPkg + "." + setting) map ( c.convert )
- }
-
- implicit val configServerConverter: Converter[Array[ConfigServer]] = new Converter[Array[ConfigServer]] {
- override def convert(s: String) = {
- s split "[, ]" filter { !_.isEmpty } map { toConfigServer }
- }
- }
-
- implicit val stringArrayConverter: Converter[Array[String]] = new Converter[Array[String]] {
- override def convert(s: String) = {
- s split "[, ]" filter { !_.isEmpty }
- }
- }
-
- private def toConfigServer(hostPort: String): ConfigServer = Try {
- val (host, portStr) = splitFirst(hostPort, ':')
- val port = portStr map { _.toInt }
- new ConfigServer(host, port)
- }.getOrElse(throw new IllegalArgumentException(s"Invalid config server '$hostPort'"))
-
- private def splitFirst(string: String, separator: Character): (String, Option[String]) = {
- val (beginning, endWithSeparator) = string span { _ != separator }
- (beginning, tailOption(endWithSeparator))
- }
-
- def tailOption(s: String) = {
- if (s.isEmpty) None
- else Some(s.tail)
- }
-
- implicit def toJavaOptional[U <% V, V](option: Option[U]): Optional[V] = option match {
- case Some(u) => Optional.of(u: V)
- case None => Optional.empty()
- }
-}
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/Environment.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/Environment.scala
index 4764f4698f0..2aab88d8319 100644
--- a/standalone-container/src/main/scala/com/yahoo/container/standalone/Environment.scala
+++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/Environment.scala
@@ -6,13 +6,13 @@ package com.yahoo.container.standalone
* TODO: copied from standalone-container. Move to separate lib module instead.
*/
object Environment {
- def optionalYinstVariable(name: String) = {
+ def optionalInstallVariable(name: String) = {
env(name.replace(".", "__")).
orElse(systemProperty(name)) //for unit testing
}
- def yinstVariable(name: String) = {
- optionalYinstVariable(name).
+ def installVariable(name: String) = {
+ optionalInstallVariable(name).
getOrElse {
throw new IllegalStateException("Environment variable not set: " + name)
}
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
index 1f3ff652224..3ebea07bfe0 100644
--- a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
+++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
@@ -40,7 +40,7 @@ class StandaloneContainerApplication @Inject()(injector: Injector) extends Appli
ConfiguredApplication.ensureVespaLoggingInitialized()
- val applicationPath: Path = injectedApplicationPath.getOrElse(yinstApplicationPath)
+ val applicationPath: Path = injectedApplicationPath.getOrElse(installApplicationPath)
val distributedFiles = new LocalFileDb(applicationPath)
@@ -73,7 +73,7 @@ class StandaloneContainerApplication @Inject()(injector: Injector) extends Appli
injector.getInstance(Key.get(classOf[Path], applicationPathName))
}.toOption
- def yinstApplicationPath = path(yinstVariable(applicationLocationYinstVariable))
+ def installApplicationPath = path(installVariable(applicationLocationInstallVariable))
override def start() {
try {
@@ -97,10 +97,10 @@ class StandaloneContainerApplication @Inject()(injector: Injector) extends Appli
object StandaloneContainerApplication {
val packageName = "standalone_jdisc_container"
- val applicationLocationYinstVariable = s"$packageName.app_location"
- val deploymentProfileYinstVariable = s"$packageName.deployment_profile"
+ val applicationLocationInstallVariable = s"$packageName.app_location"
+ val deploymentProfileInstallVariable = s"$packageName.deployment_profile"
- val applicationPathName = Names.named(applicationLocationYinstVariable)
+ val applicationPathName = Names.named(applicationLocationInstallVariable)
val disableNetworkingAnnotation = "JDisc.disableNetworking"
val configModelRepoName = Names.named("ConfigModelRepo")
@@ -143,9 +143,9 @@ object StandaloneContainerApplication {
}
def newContainerModelBuilder(networkingOption: Networking): ContainerModelBuilder = {
- optionalYinstVariable(deploymentProfileYinstVariable) match {
+ optionalInstallVariable(deploymentProfileInstallVariable) match {
case None => new ContainerModelBuilder(true, networkingOption)
- case Some("configserver") => new ConfigServerContainerModelBuilder(new CloudConfigYinstVariables)
+ case Some("configserver") => new ConfigServerContainerModelBuilder(new CloudConfigInstallVariables)
case profileName => throw new RuntimeException(s"Invalid deployment profile '$profileName'")
}
}
diff --git a/standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigYinstVariablesTest.scala b/standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.scala
index 585221a8795..efa3edb7b7e 100644
--- a/standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigYinstVariablesTest.scala
+++ b/standalone-container/src/test/scala/com/yahoo/container/standalone/CloudConfigInstallVariablesTest.scala
@@ -11,8 +11,8 @@ import org.hamcrest.Matchers.{arrayContaining}
* @author tonytv
* @since 5.
*/
-class CloudConfigYinstVariablesTest {
- def convert = CloudConfigYinstVariables.configServerConverter.convert _
+class CloudConfigInstallVariablesTest {
+ def convert = CloudConfigInstallVariables.configServerConverter.convert _
@Test
def test_configserver_parsing {
diff --git a/standalone-container/src/test/scala/com/yahoo/container/standalone/StandaloneContainer.scala b/standalone-container/src/test/scala/com/yahoo/container/standalone/StandaloneContainer.scala
index b70eefe0681..33f9a2e8594 100644
--- a/standalone-container/src/test/scala/com/yahoo/container/standalone/StandaloneContainer.scala
+++ b/standalone-container/src/test/scala/com/yahoo/container/standalone/StandaloneContainer.scala
@@ -23,7 +23,7 @@ object StandaloneContainer {
def withStandaloneContainer[T](containerNode: Node) {
withTempDirectory { applicationDirectory =>
- System.setProperty(StandaloneContainerApplication.applicationLocationYinstVariable, applicationDirectory.toString)
+ System.setProperty(StandaloneContainerApplication.applicationLocationInstallVariable, applicationDirectory.toString)
createServicesXml(applicationDirectory, containerNode)
val driver = TestDriver.newInjectedApplicationInstance(classOf[StandaloneContainerApplication])