summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-10-21 22:53:02 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2018-10-21 22:53:02 +0200
commit73b3ce008bd1b18d11564ff51b198066f7d71ac6 (patch)
treeabd5bdb4d9e4a00638c0555c1da76bcbfa9bc211 /config-model
parent55af2fe38bfd0491e676228450157249c1307061 (diff)
Optional intended as a return value, not as fields.
Diffstat (limited to 'config-model')
-rwxr-xr-xconfig-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
index d11aa45aef1..8e096b14d85 100755
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
@@ -89,7 +89,7 @@ public class ContainerClusterTest {
}
private ContainerCluster createContainerCluster(MockRoot root, boolean isCombinedCluster) {
- return createContainerCluster(root, isCombinedCluster, Optional.empty(), Optional.empty());
+ return createContainerCluster(root, isCombinedCluster, null, Optional.empty());
}
private ContainerCluster createClusterControllerCluster(MockRoot root) {
@@ -97,11 +97,10 @@ public class ContainerClusterTest {
}
private ContainerCluster createContainerCluster(MockRoot root, boolean isCombinedCluster, ContainerClusterVerifier extraComponents) {
- return createContainerCluster(root, isCombinedCluster, Optional.empty(), Optional.of(extraComponents));
+ return createContainerCluster(root, isCombinedCluster, null, Optional.of(extraComponents));
}
- private ContainerCluster createContainerCluster(MockRoot root, boolean isCombinedCluster,
- Optional<Integer> memoryPercentage) {
+ private ContainerCluster createContainerCluster(MockRoot root, boolean isCombinedCluster, Integer memoryPercentage) {
return createContainerCluster(root, isCombinedCluster, memoryPercentage, Optional.empty());
}
private MockRoot createRoot(boolean isHosted) {
@@ -109,19 +108,19 @@ public class ContainerClusterTest {
return new MockRoot("foo", state);
}
private ContainerCluster createContainerCluster(MockRoot root, boolean isCombinedCluster,
- Optional<Integer> memoryPercentage, Optional<ContainerClusterVerifier> extraComponents) {
+ Integer memoryPercentage, Optional<ContainerClusterVerifier> extraComponents) {
ContainerCluster cluster = extraComponents.isPresent()
? new ContainerCluster(root, "container0", "container1", extraComponents.get(), root.getDeployState())
: new ContainerCluster(root, "container0", "container1", root.getDeployState());
if (isCombinedCluster)
cluster.setHostClusterId("test-content-cluster");
- cluster.setMemoryPercentage(memoryPercentage.get());
+ cluster.setMemoryPercentage(memoryPercentage);
cluster.setSearch(new ContainerSearch(cluster, new SearchChains(cluster, "search-chain"), new ContainerSearch.Options()));
return cluster;
}
private void verifyHeapSizeAsPercentageOfPhysicalMemory(boolean isHosted, boolean isCombinedCluster,
- Optional<Integer> explicitMemoryPercentage,
+ Integer explicitMemoryPercentage,
int expectedMemoryPercentage) {
ContainerCluster cluster = createContainerCluster(createRoot(isHosted), isCombinedCluster, explicitMemoryPercentage);
QrStartConfig.Builder qsB = new QrStartConfig.Builder();
@@ -134,14 +133,14 @@ public class ContainerClusterTest {
public void requireThatHeapSizeAsPercentageOfPhysicalMemoryForHostedAndNot() {
boolean hosted = true;
boolean combined = true; // a cluster running on content nodes (only relevant with hosted)
- verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, ! combined, Optional.empty(), 60);
- verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, combined, Optional.empty(), 17);
- verifyHeapSizeAsPercentageOfPhysicalMemory(! hosted, ! combined, Optional.empty(), 0);
+ verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, ! combined, null, 60);
+ verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, combined, null, 17);
+ verifyHeapSizeAsPercentageOfPhysicalMemory(! hosted, ! combined, null, 0);
// Explicit value overrides all defaults
- verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, ! combined, Optional.of(67), 67);
- verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, combined, Optional.of(68), 68);
- verifyHeapSizeAsPercentageOfPhysicalMemory(! hosted, ! combined, Optional.of(69), 69);
+ verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, ! combined, 67, 67);
+ verifyHeapSizeAsPercentageOfPhysicalMemory( hosted, combined, 68, 68);
+ verifyHeapSizeAsPercentageOfPhysicalMemory(! hosted, ! combined, 69, 69);
}
private void verifyJvmArgs(boolean isHosted, boolean hasDocproc, String expectedArgs, String jvmArgs) {