summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Musum <musum@oath.com>2017-11-28 13:55:00 +0100
committerHarald Musum <musum@oath.com>2017-11-28 13:55:00 +0100
commitf905e3b6698b4e7bccedc9d8951c628fbe142c8c (patch)
tree8ae1e23c3622889df10628f3e6944f541f2404de
parent366549a4805df6e42d97c814216f6693ffc1a7b6 (diff)
Rename element to disable filedistributor
Keep old until it is not used anymore
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminBuilderBase.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomFileDistributionOptionsBuilder.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributorService.java4
-rw-r--r--config-model/src/main/resources/schema/admin.rnc3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java5
6 files changed, 13 insertions, 15 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java
index 0160978773d..8b39a1ecb94 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java
@@ -21,7 +21,7 @@ public class FileDistributionOptions implements FiledistributorConfig.Producer {
private BinaryScaledAmount uploadBitRate = new BinaryScaledAmount();
private BinaryScaledAmount downloadBitRate = new BinaryScaledAmount();
- private boolean disabled = false;
+ private boolean disableFiledistributor = false;
public void downloadBitRate(BinaryScaledAmount amount) {
@@ -34,12 +34,12 @@ public class FileDistributionOptions implements FiledistributorConfig.Producer {
uploadBitRate = amount;
}
- public void disabled(boolean value) {
- disabled = value;
+ public void disableFiledistributor(boolean value) {
+ disableFiledistributor = value;
}
- public boolean disabled() {
- return disabled;
+ public boolean disableFiledistributor() {
+ return disableFiledistributor;
}
private void ensureNonNegative(BinaryScaledAmount amount) {
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminBuilderBase.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminBuilderBase.java
index 3e825c3912a..c2ba2efac71 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminBuilderBase.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminBuilderBase.java
@@ -80,7 +80,7 @@ public abstract class DomAdminBuilderBase extends VespaDomBuilder.DomConfigProdu
new ModelConfigProvider(admin);
FileDistributionOptions fileDistributionOptions = FileDistributionOptions.defaultOptions();
- fileDistributionOptions.disabled(disableFiledistributor);
+ fileDistributionOptions.disableFiledistributor(disableFiledistributor);
fileDistributionOptions = new DomFileDistributionOptionsBuilder(fileDistributionOptions).build(XML.getChild(adminElement, "filedistribution"));
admin.setFileDistribution(new FileDistributionConfigProducer.Builder(fileDistributionOptions).build(parent, fileRegistry));
return admin;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomFileDistributionOptionsBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomFileDistributionOptionsBuilder.java
index 90d71f186ae..ef0984662b9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomFileDistributionOptionsBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomFileDistributionOptionsBuilder.java
@@ -42,9 +42,9 @@ public class DomFileDistributionOptionsBuilder {
if (fileDistributionElement != null) {
getAmount("uploadbitrate", fileDistributionElement).ifPresent(fileDistributionOptions::uploadBitRate);
getAmount("downloadbitrate", fileDistributionElement).ifPresent(fileDistributionOptions::downloadBitRate);
- Element disable = XML.getChild(fileDistributionElement, "disabled");
+ Element disable = XML.getChild(fileDistributionElement, "disableFiledistributor");
if (disable != null) {
- fileDistributionOptions.disabled(Boolean.valueOf(XML.getValue(disable)));
+ fileDistributionOptions.disableFiledistributor(Boolean.valueOf(XML.getValue(disable)));
}
}
return fileDistributionOptions;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributorService.java b/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributorService.java
index dd9e057e2fa..7616b721be9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributorService.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributorService.java
@@ -55,7 +55,7 @@ public class FileDistributorService extends AbstractService implements
@Override
public String getStartupCommand() {
// If disabled config proxy should act as file distributor, so don't start this service
- return (fileDistributionOptions.disabled())
+ return (fileDistributionOptions.disableFiledistributor())
? null
: "exec $ROOT/sbin/vespa-filedistributor" + " --configid " + getConfigId();
}
@@ -91,7 +91,7 @@ public class FileDistributorService extends AbstractService implements
@Override
public void getConfig(FiledistributorrpcConfig.Builder builder) {
// If disabled config proxy should act as file distributor, so use config proxy port
- int port = (fileDistributionOptions.disabled()) ? 19090 : getRelativePort(0);
+ int port = (fileDistributionOptions.disableFiledistributor()) ? 19090 : getRelativePort(0);
builder.connectionspec("tcp/" + getHostName() + ":" + port);
}
diff --git a/config-model/src/main/resources/schema/admin.rnc b/config-model/src/main/resources/schema/admin.rnc
index b7ec252c4d7..f787335d735 100644
--- a/config-model/src/main/resources/schema/admin.rnc
+++ b/config-model/src/main/resources/schema/admin.rnc
@@ -81,7 +81,8 @@ LogServer = element logserver {
FileDistribution = element filedistribution {
element uploadbitrate { xsd:string { pattern = "\d+(\.\d*)?\s*[kmgKMG]?" } }? &
element downloadbitrate { xsd:string { pattern = "\d+(\.\d*)?\s*[kmgKMG]?" } }? &
- element disabled { xsd:boolean }? # Nov. 2017: Temporary, should not be documented
+ element disabled { xsd:boolean }? & # Nov. 2017: Temporary, should not be documented, can be removed as soon as no config model is using it
+ element disableFiledistributor { xsd:boolean }? # Nov. 2017: Temporary, should not be documented
}
Metrics = element metrics {
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 d8bf40ac2d8..fed9000f72b 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,11 +23,9 @@ 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 com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg;
-import org.junit.Ignore;
import org.junit.Test;
import java.util.Set;
-import java.util.stream.IntStream;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
@@ -288,7 +285,7 @@ public class AdminTestCase {
" <admin version='2.0'>" +
" <adminserver hostalias='node0' />" +
" <filedistribution>" +
- " <disabled>true</disabled>" +
+ " <disableFiledistributor>true</disableFiledistributor>" +
" </filedistribution>" +
" </admin>" +
"</services>";