summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-11-01 23:17:27 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-11-01 23:18:07 +0100
commit13e7ffb85bad06d12a3c31034746c25c242c7c73 (patch)
tree53744c6e08c7e8ae00a14d678e0386aa39c70cea /config-model
parentad224f67874ca12be856afacfb4b7bfb197bc086 (diff)
gcopts -> jvm-gc-options
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java2
-rwxr-xr-xconfig-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java13
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java16
-rw-r--r--config-model/src/main/resources/schema/common.rnc2
-rw-r--r--config-model/src/main/resources/schema/containercluster.rnc2
-rw-r--r--config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java34
7 files changed, 35 insertions, 38 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java
index 1f6f7ad6c69..c022f20db70 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java
@@ -44,7 +44,7 @@ import java.util.logging.Logger;
public class VespaDomBuilder extends VespaModelBuilder {
public static final String JVMARGS_ATTRIB_NAME = "jvmargs";
- public static final String GCOPTS_ATTRIB_NAME = "gcopts";
+ public static final String JVM_GC_OPTIONS = "jvm-gc-options";
public static final String PRELOAD_ATTRIB_NAME = "preload"; // Intended for vespa engineers
public static final String MMAP_NOCORE_LIMIT = "mmap-core-limit"; // Intended for vespa engineers
public static final String CORE_ON_OOM = "core-on-oom"; // Intended for vespa engineers
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
index 88669ef2bb3..29a758fee74 100755
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
@@ -14,9 +14,6 @@ import com.yahoo.config.docproc.SchemamappingConfig;
import com.yahoo.config.model.ApplicationConfigProducerRoot;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
-import com.yahoo.config.provision.Environment;
-import com.yahoo.config.provision.RegionName;
-import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.Zone;
import com.yahoo.container.BundlesConfig;
import com.yahoo.container.ComponentsConfig;
@@ -186,7 +183,7 @@ public final class ContainerCluster
private Zone zone;
private String hostClusterId = null;
- private String gcopts = null;
+ private String jvmGCOptions = null;
private Integer memoryPercentage = null;
private static class AcceptAllVerifier implements ContainerClusterVerifier {
@@ -642,8 +639,8 @@ public final class ContainerCluster
if (containerSearch!=null) {
jvmBuilder.directMemorySizeCache(containerSearch.totalCacheSizeMb());
}
- if (gcopts != null) {
- jvmBuilder.gcopts(gcopts);
+ if (jvmGCOptions != null) {
+ jvmBuilder.gcopts(jvmGCOptions);
}
builder.jvm(jvmBuilder);
}
@@ -802,8 +799,8 @@ public final class ContainerCluster
public Optional<String> getHostClusterId() { return Optional.ofNullable(hostClusterId); }
public void setMemoryPercentage(Integer memoryPercentage) { this.memoryPercentage = memoryPercentage; }
- public void setGCOpts(String gcopts) { this.gcopts = gcopts; }
- public Optional<String> getGCOpts() { return Optional.ofNullable(gcopts); }
+ public void setJvmGCOptions(String opts) { this.jvmGCOptions = opts; }
+ public Optional<String> getJvmGCOptions() { return Optional.ofNullable(jvmGCOptions); }
/**
* Returns the percentage of host physical memory this application has specified for nodes in this cluster,
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 4f3ae9b7f9d..5f9b3e875e6 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
@@ -459,9 +459,9 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
return (gcAlgorithm.matcher(jvmargs).find() ||cmsArgs.matcher(jvmargs).find());
}
- private static String buildGCOpts(Zone zone, String gcopts, boolean isHostedVespa) {
- if (gcopts != null) {
- return gcopts;
+ private static String buildJvmGCOptions(Zone zone, String jvmGCOPtions, boolean isHostedVespa) {
+ if (jvmGCOPtions != null) {
+ return jvmGCOPtions;
} else if (zone.system() == SystemName.dev) {
return ContainerCluster.G1GC;
} else if (isHostedVespa) {
@@ -483,14 +483,14 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
else {
List<Container> nodes = createNodes(cluster, nodesElement, context);
String jvmArgs = nodesElement.getAttribute(VespaDomBuilder.JVMARGS_ATTRIB_NAME);
- String gcopts = nodesElement.hasAttribute(VespaDomBuilder.GCOPTS_ATTRIB_NAME)
- ? nodesElement.getAttribute(VespaDomBuilder.GCOPTS_ATTRIB_NAME)
+ String jvmGCOptions = nodesElement.hasAttribute(VespaDomBuilder.JVM_GC_OPTIONS)
+ ? nodesElement.getAttribute(VespaDomBuilder.JVM_GC_OPTIONS)
: null;
if (incompatibleGCOptions(jvmArgs)) {
- context.getDeployLogger().log(Level.WARNING, "You need to move out your GC related options from 'jvmargs' to 'gcopts'");
- cluster.setGCOpts(ContainerCluster.CMS);
+ context.getDeployLogger().log(Level.WARNING, "You need to move out your GC related options from 'jvmargs' to 'jvm-gc-options'");
+ cluster.setJvmGCOptions(ContainerCluster.CMS);
} else {
- cluster.setGCOpts(buildGCOpts(context.getDeployState().zone(), gcopts, context.getDeployState().isHosted()));
+ cluster.setJvmGCOptions(buildJvmGCOptions(context.getDeployState().zone(), jvmGCOptions, context.getDeployState().isHosted()));
}
applyNodesTagJvmArgs(nodes, jvmArgs);
applyRoutingAliasProperties(nodes, cluster);
diff --git a/config-model/src/main/resources/schema/common.rnc b/config-model/src/main/resources/schema/common.rnc
index 6a82556f01b..32ba67b6429 100644
--- a/config-model/src/main/resources/schema/common.rnc
+++ b/config-model/src/main/resources/schema/common.rnc
@@ -2,7 +2,7 @@
service.attlist &= attribute hostalias { xsd:NCName }
service.attlist &= attribute baseport { xsd:unsignedShort }?
service.attlist &= attribute jvmargs { text }?
-service.attlist &= attribute gcopts { text }?
+service.attlist &= attribute jvm-gc-options { text }?
# preload is for internal use only
service.attlist &= attribute preload { text }?
diff --git a/config-model/src/main/resources/schema/containercluster.rnc b/config-model/src/main/resources/schema/containercluster.rnc
index 4862fdf7a50..9acb9daaba5 100644
--- a/config-model/src/main/resources/schema/containercluster.rnc
+++ b/config-model/src/main/resources/schema/containercluster.rnc
@@ -211,7 +211,7 @@ DocumentApi = element document-api {
NodesOfContainerCluster = element nodes {
attribute jvmargs { text }? &
- attribute gcopts { text }? &
+ attribute jvm-gc-options { text }? &
attribute preload { text }? &
attribute allocated-memory { text }? &
attribute cpu-socket-affinity { xsd:boolean }? &
diff --git a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
index 8396cac265c..743dfc5ca73 100644
--- a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
+++ b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java
@@ -86,7 +86,7 @@ public class ModelProvisioningTest {
" <handler id='myHandler'>" +
" <component id='injected' />" +
" </handler>" +
- " <nodes count='2' allocated-memory='45%' gcopts='-XX:+UseParNewGC' jvmargs='-verbosegc' preload='lib/blablamalloc.so'/>" +
+ " <nodes count='2' allocated-memory='45%' jvm-gc-options='-XX:+UseParNewGC' jvmargs='-verbosegc' preload='lib/blablamalloc.so'/>" +
"</jdisc>" +
"</services>";
String hosts ="<hosts>"
@@ -140,7 +140,7 @@ public class ModelProvisioningTest {
assertThat(mydisc2.getContainers().get(0).getPreLoad(), is("lib/blablamalloc.so"));
assertThat(mydisc2.getContainers().get(1).getPreLoad(), is("lib/blablamalloc.so"));
assertThat(mydisc2.getMemoryPercentage(), is(Optional.of(45)));
- assertThat(mydisc2.getGCOpts(), is(Optional.of("-XX:+UseParNewGC")));
+ assertThat(mydisc2.getJvmGCOptions(), is(Optional.of("-XX:+UseParNewGC")));
QrStartConfig.Builder qrStartBuilder = new QrStartConfig.Builder();
mydisc2.getConfig(qrStartBuilder);
QrStartConfig qrsStartConfig = new QrStartConfig(qrStartBuilder);
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 f1c2d53c9f9..efa0d42f014 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
@@ -70,7 +70,7 @@ import static org.junit.Assert.fail;
public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
@Test
- public void detect_conflicting_gcoptions_in_jvmargs() {
+ public void detect_conflicting_jvmgcoptions_in_jvmargs() {
assertFalse(ContainerModelBuilder.incompatibleGCOptions(""));
assertFalse(ContainerModelBuilder.incompatibleGCOptions("UseG1GC"));
assertTrue(ContainerModelBuilder.incompatibleGCOptions("-XX:+UseG1GC"));
@@ -79,11 +79,11 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
}
@Test
- public void honours_gcopts() {
+ public void honours_jvm_gc_options() {
Element clusterElem = DomBuilderTest.parse(
"<jdisc version='1.0'>",
" <search/>",
- " <nodes gcopts='-XX:+UseG1GC'>",
+ " <nodes jvm-gc-options='-XX:+UseG1GC'>",
" <node hostalias='mockhost'/>",
" </nodes>",
"</jdisc>" );
@@ -97,7 +97,7 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
private static void verifyIgnoreJvmGCOptions(boolean isHosted) throws IOException, SAXException {
String servicesXml =
"<jdisc version='1.0'>" +
- " <nodes gcopts='-XX:+UseG1GC' jvmargs='-XX:+UseParNewGC'>" +
+ " <nodes jvm-gc-options='-XX:+UseG1GC' jvmargs='-XX:+UseParNewGC'>" +
" <node hostalias='mockhost'/>" +
" </nodes>" +
"</jdisc>";
@@ -119,15 +119,15 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
}
@Test
- public void ignores_gcopts_on_conflicting_jvargs() throws IOException, SAXException {
+ public void ignores_jvmgcoptions_on_conflicting_jvmargs() throws IOException, SAXException {
verifyIgnoreJvmGCOptions(false);
verifyIgnoreJvmGCOptions(true);
}
- private void verifyGCOpts(boolean isHosted, String override, Zone zone, String expected) throws IOException, SAXException {
+ private void verifyJvmGCOptions(boolean isHosted, String override, Zone zone, String expected) throws IOException, SAXException {
String servicesXml =
"<jdisc version='1.0'>" +
- " <nodes " + ((override == null) ? ">" : ("gcopts='" + override + "'>")) +
+ " <nodes " + ((override == null) ? ">" : ("jvm-gc-options='" + override + "'>")) +
" <node hostalias='mockhost'/>" +
" </nodes>" +
"</jdisc>";
@@ -148,21 +148,21 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
assertEquals(expected, qrStartConfig.jvm().gcopts());
}
- private void verifyGCOpts(boolean isHosted, Zone zone, String expected) throws IOException, SAXException {
- verifyGCOpts(isHosted, null, zone, expected);
- verifyGCOpts(isHosted, "-XX:+UseG1GC", zone, "-XX:+UseG1GC");
+ private void verifyJvmGCOptions(boolean isHosted, Zone zone, String expected) throws IOException, SAXException {
+ verifyJvmGCOptions(isHosted, null, zone, expected);
+ verifyJvmGCOptions(isHosted, "-XX:+UseG1GC", zone, "-XX:+UseG1GC");
Zone DEV = new Zone(SystemName.dev, zone.environment(), zone.region());
- verifyGCOpts(isHosted, null, DEV, ContainerCluster.G1GC);
- verifyGCOpts(isHosted, "-XX:+UseConcMarkSweepGC", DEV, "-XX:+UseConcMarkSweepGC");
+ verifyJvmGCOptions(isHosted, null, DEV, ContainerCluster.G1GC);
+ verifyJvmGCOptions(isHosted, "-XX:+UseConcMarkSweepGC", DEV, "-XX:+UseConcMarkSweepGC");
}
@Test
- public void requireThatGCOptsIsHonoured() throws IOException, SAXException {
+ public void requireThatJvmGCOptionsIsHonoured() throws IOException, SAXException {
final Zone US_EAST_3 = new Zone(Environment.prod, RegionName.from("us-east-3"));
- verifyGCOpts(false, Zone.defaultZone(),ContainerCluster.CMS);
- verifyGCOpts(false, US_EAST_3, ContainerCluster.CMS);
- verifyGCOpts(true, Zone.defaultZone(), ContainerCluster.CMS);
- verifyGCOpts(true, US_EAST_3, ContainerCluster.G1GC);
+ verifyJvmGCOptions(false, Zone.defaultZone(),ContainerCluster.CMS);
+ verifyJvmGCOptions(false, US_EAST_3, ContainerCluster.CMS);
+ verifyJvmGCOptions(true, Zone.defaultZone(), ContainerCluster.CMS);
+ verifyJvmGCOptions(true, US_EAST_3, ContainerCluster.G1GC);
}
@Test