diff options
author | Harald Musum <musum@yahoo-inc.com> | 2018-02-15 15:25:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 15:25:17 +0100 |
commit | ff8eab557d523981add40e4ff642c06bb3524016 (patch) | |
tree | bae2ea59f83dd8cefd0dab67fe75340dc7f9c424 /config-model | |
parent | 55c7376e90021d181eac71fa229b967825bdb49d (diff) | |
parent | 49e720d867f99f22e4a72e9fd7f48c5a8186912f (diff) |
Merge pull request #4990 from vespa-engine/balder/remove-filedistribution-config
Remove unused code.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java | 56 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java | 1 |
2 files changed, 0 insertions, 57 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 deleted file mode 100644 index 22855709208..00000000000 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java +++ /dev/null @@ -1,56 +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.vespa.model.admin; - -import com.yahoo.binaryprefix.BinaryPrefix; -import com.yahoo.binaryprefix.BinaryScaledAmount; -import com.yahoo.cloud.config.filedistribution.FiledistributorConfig; - -/** - * Options for controlling the behavior of the file distribution services. - * - * @author tonytv - */ -public class FileDistributionOptions implements FiledistributorConfig.Producer { - - private FileDistributionOptions() { - } - - private BinaryScaledAmount uploadBitRate = new BinaryScaledAmount(); - private BinaryScaledAmount downloadBitRate = new BinaryScaledAmount(); - private boolean disableFiledistributor = false; - - - public void downloadBitRate(BinaryScaledAmount amount) { - ensureNonNegative(amount); - downloadBitRate = amount; - } - - public void uploadBitRate(BinaryScaledAmount amount) { - ensureNonNegative(amount); - uploadBitRate = amount; - } - - public void disableFiledistributor(boolean value) { - disableFiledistributor = value; - } - - public boolean disableFiledistributor() { - return disableFiledistributor; - } - - private void ensureNonNegative(BinaryScaledAmount amount) { - if (amount.amount < 0) - throw new IllegalArgumentException("Expected non-negative number, got " + amount.amount); - } - - private int byteRate(BinaryScaledAmount bitRate) { - BinaryScaledAmount byteRate = bitRate.divide(8); - return (int) byteRate.as(BinaryPrefix.unit); - } - - @Override - public void getConfig(FiledistributorConfig.Builder builder) { - builder.maxuploadspeed((double) byteRate(uploadBitRate)); - builder.maxdownloadspeed((double) byteRate(downloadBitRate)); - } -} diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java index 1373acdf5d2..7acc1fb3069 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java @@ -12,7 +12,6 @@ import com.yahoo.config.model.test.MockApplicationPackage; import com.yahoo.config.model.test.MockRoot; import com.yahoo.text.XML; import com.yahoo.vespa.model.admin.Admin; -import com.yahoo.vespa.model.admin.FileDistributionOptions; import com.yahoo.vespa.model.admin.monitoring.DefaultMonitoring; import com.yahoo.vespa.model.admin.monitoring.builder.Metrics; import com.yahoo.vespa.model.content.cluster.ContentCluster; |