summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorOla Aunrønning <olaa@oath.com>2019-10-23 13:46:31 +0200
committerGitHub <noreply@github.com>2019-10-23 13:46:31 +0200
commitcc452779e3e8a1b753681dadf17e5da66991e222 (patch)
tree38054cdb9acf64503a9fa47f1df71deef0aeecba /controller-api
parent829411ea4336f1924d9ba04ee95e036be81e7f9f (diff)
Revert "Added TenantCost"
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/CostInfo.java69
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MeteringClient.java6
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java37
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java34
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockMeteringClient.java4
6 files changed, 3 insertions, 150 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 dec5d9264a7..f545cb8ff47 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
@@ -17,7 +17,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.routing.RoutingGenerator;
@@ -71,6 +70,4 @@ public interface ServiceRegistry {
// TODO: No longer used. Remove this once untangled from test code
BuildService buildService();
- TenantCost tenantCost();
-
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/CostInfo.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/CostInfo.java
deleted file mode 100644
index 50c257acd23..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/CostInfo.java
+++ /dev/null
@@ -1,69 +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.ApplicationId;
-import com.yahoo.config.provision.zone.ZoneId;
-
-import java.math.BigDecimal;
-
-/**
- * @author olaa
- */
-public class CostInfo {
-
- private final ApplicationId applicationId;
- private final ZoneId zoneId;
- private final BigDecimal cpuHours;
- private final BigDecimal memoryHours;
- private final BigDecimal diskHours;
- private final int cpuCost;
- private final int memoryCost;
- private final int diskCost;
-
-
- public CostInfo(ApplicationId applicationId, ZoneId zoneId,
- BigDecimal cpuHours, BigDecimal memoryHours, BigDecimal diskHours,
- int cpuCost, int memoryCost, int diskCost) {
- this.applicationId = applicationId;
- this.zoneId = zoneId;
- this.cpuHours = cpuHours;
- this.memoryHours = memoryHours;
- this.diskHours = diskHours;
- this.cpuCost = cpuCost;
- this.memoryCost = memoryCost;
- this.diskCost = diskCost;
- }
-
- public ApplicationId getApplicationId() {
- return applicationId;
- }
-
- public ZoneId getZoneId() {
- return zoneId;
- }
-
- public BigDecimal getCpuHours() {
- return cpuHours;
- }
-
- public BigDecimal getMemoryHours() {
- return memoryHours;
- }
-
- public BigDecimal getDiskHours() {
- return diskHours;
- }
-
- public int getCpuCost() {
- return cpuCost;
- }
-
- public int getMemoryCost() {
- return memoryCost;
- }
-
- public int getDiskCost() {
- return diskCost;
- }
-
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MeteringClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MeteringClient.java
index 3e06b24c6be..632dbaad419 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MeteringClient.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MeteringClient.java
@@ -1,10 +1,8 @@
// 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.ApplicationName;
-import com.yahoo.config.provision.TenantName;
-
import java.util.Collection;
+import java.util.List;
/**
* Consumes and retrieves snapshots of resources allocated per application.
@@ -15,6 +13,6 @@ public interface MeteringClient {
void consume(Collection<ResourceSnapshot> resources);
- MeteringInfo getResourceSnapshots(TenantName tenantName, ApplicationName applicationName);
+ MeteringInfo getResourceSnapshots(String tenantName, String applicationName);
}
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 03ba44e04c7..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java
+++ /dev/null
@@ -1,37 +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.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> getTenantCostOfMonth(TenantName tenantName, YearMonth month) {
- 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 b4ca0cd7076..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java
+++ /dev/null
@@ -1,34 +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.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author olaa
- */
-public interface TenantCost {
-
- Set<YearMonth> monthsWithMetering(TenantName tenantName);
-
- List<CostInfo> getTenantCostOfMonth(TenantName tenantName, YearMonth month);
-
- static TenantCost empty() {
- return new TenantCost() {
- @Override
- public Set<YearMonth> monthsWithMetering(TenantName tenantName) {
- return Collections.emptySet();
- }
-
- @Override
- public List<CostInfo> getTenantCostOfMonth(TenantName tenantName, YearMonth month) {
- return Collections.emptyList();
- }
- };
- }
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockMeteringClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockMeteringClient.java
index 45ead36f622..10e1eb39c8a 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockMeteringClient.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockMeteringClient.java
@@ -1,8 +1,6 @@
// 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.stubs;
-import com.yahoo.config.provision.ApplicationName;
-import com.yahoo.config.provision.TenantName;
import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringInfo;
import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation;
import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceSnapshot;
@@ -28,7 +26,7 @@ public class MockMeteringClient implements MeteringClient {
}
@Override
- public MeteringInfo getResourceSnapshots(TenantName tenantName, ApplicationName applicationName) {
+ public MeteringInfo getResourceSnapshots(String tenantName, String applicationName) {
return meteringInfo.orElseGet(() -> {
ResourceAllocation emptyAllocation = new ResourceAllocation(0, 0, 0);
return new MeteringInfo(emptyAllocation, emptyAllocation, emptyAllocation, Collections.emptyMap());