summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2020-05-12 16:26:13 +0200
committerØyvind Grønnesby <oyving@verizonmedia.com>2020-05-12 16:26:13 +0200
commit865b7d77b1898cff1aa146b689ed28d6ec5ea01e (patch)
treef3a9cf8592280306d8d65cc84a50e3cd568f12fa /controller-api
parent92440039ab85478d62fcb5afb18ec8ea5f8da04b (diff)
Remove the TenantCost interface and the tenant cost API
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java3
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java36
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java53
3 files changed, 0 insertions, 92 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
index ca939023245..f87c764b3fd 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
@@ -18,7 +18,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.Mailer;
import com.yahoo.vespa.hosted.controller.api.integration.organization.OwnershipIssues;
import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumer;
import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringClient;
-import com.yahoo.vespa.hosted.controller.api.integration.resource.TenantCost;
import com.yahoo.vespa.hosted.controller.api.integration.routing.GlobalRoutingService;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
@@ -70,8 +69,6 @@ public interface ServiceRegistry {
RunDataStore runDataStore();
- TenantCost tenantCost();
-
ZoneRegistry zoneRegistry();
ResourceTagger resourceTagger();
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java
deleted file mode 100644
index fa3d28fe50c..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.resource;
-
-import com.yahoo.config.provision.TenantName;
-
-import java.time.YearMonth;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author olaa
- */
-public class MockTenantCost implements TenantCost {
-
- private Set<YearMonth> monthsOfMetering = Collections.emptySet();
- private List<CostInfo> costInfoList = Collections.emptyList();
-
- @Override
- public Set<YearMonth> monthsWithMetering(TenantName tenantName) {
- return monthsOfMetering;
- }
-
- @Override
- public List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTimestamp, long endTimestamp) {
- return costInfoList;
- }
-
- public void setMonthsWithMetering(Set<YearMonth> monthsOfMetering) {
- this.monthsOfMetering = monthsOfMetering;
- }
-
- public void setCostInfoList(List<CostInfo> costInfoList) {
- this.costInfoList = costInfoList;
- }
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java
deleted file mode 100644
index a2a91454366..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.resource;
-
-import com.yahoo.config.provision.TenantName;
-
-import java.time.LocalDate;
-import java.time.YearMonth;
-import java.time.temporal.ChronoUnit;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author olaa
- */
-public interface TenantCost {
-
- Set<YearMonth> monthsWithMetering(TenantName tenantName);
-
- List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTimestamp, long endTimestamp);
-
- default List<CostInfo> getTenantCostOfMonth(TenantName tenantName, YearMonth month) {
- return getTenantCostOfPeriod(tenantName, getMonthStartTimeStamp(month), getMonthEndTimeStamp(month));
- }
-
- static TenantCost empty() {
- return new TenantCost() {
- @Override
- public Set<YearMonth> monthsWithMetering(TenantName tenantName) {
- return Collections.emptySet();
- }
-
- @Override
- public List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTime, long endTime) {
- return Collections.emptyList();
- }
- };
- }
-
- private long getMonthStartTimeStamp(YearMonth month) {
- LocalDate startOfMonth = LocalDate.of(month.getYear(), month.getMonth(), 1);
- return startOfMonth.atStartOfDay(java.time.ZoneId.of("UTC"))
- .toInstant()
- .toEpochMilli();
- }
- private long getMonthEndTimeStamp(YearMonth month) {
- LocalDate startOfMonth = LocalDate.of(month.getYear(), month.getMonth(), 1);
- return startOfMonth.plus(1, ChronoUnit.MONTHS)
- .atStartOfDay(java.time.ZoneId.of("UTC"))
- .toInstant()
- .toEpochMilli();
- }
-}