From 73734b44312871b5b35d59e3d5a8562fb4785d0e Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 9 Feb 2018 11:30:20 +0100 Subject: Remove unused code. --- .../vespa/model/admin/FileDistributionOptions.java | 56 ---------------------- .../model/content/utils/ContentClusterUtils.java | 1 - 2 files changed, 57 deletions(-) delete mode 100644 config-model/src/main/java/com/yahoo/vespa/model/admin/FileDistributionOptions.java (limited to 'config-model') 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; -- cgit v1.2.3