diff options
author | Morten Tokle <mortent@oath.com> | 2019-01-17 09:48:24 +0100 |
---|---|---|
committer | Morten Tokle <mortent@oath.com> | 2019-01-24 15:31:33 +0100 |
commit | 8a3ac6e851a97ec44a84dfc5942b3f1d74afe092 (patch) | |
tree | 22aa0d01c0c3cf95a581db6a63b6c96ba584e21b /controller-api | |
parent | 894c4fdd551f11f415c08c09af64c3228a57d74a (diff) |
Review fixes
Diffstat (limited to 'controller-api')
2 files changed, 14 insertions, 6 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java index a0cb76860a7..e8300262a89 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java @@ -1,19 +1,26 @@ // Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.configserver; +import com.yahoo.config.provision.ClusterSpec; +import com.yahoo.config.provision.HostName; import com.yahoo.vespa.hosted.controller.api.identifiers.ApplicationId; import com.yahoo.vespa.hosted.controller.api.identifiers.InstanceId; import com.yahoo.vespa.hosted.controller.api.identifiers.TenantId; +/** + * A load balancer + * + * @author mortent + */ public class LoadBalancer { private final String id; private final TenantId tenant; private final ApplicationId application; private final InstanceId instance; - private final String cluster; - private final String hostname; + private final ClusterSpec.Id cluster; + private final HostName hostname; - public LoadBalancer(String id, TenantId tenant, ApplicationId application, InstanceId instance, String cluster, String hostname) { + public LoadBalancer(String id, TenantId tenant, ApplicationId application, InstanceId instance, ClusterSpec.Id cluster, HostName hostname) { this.id = id; this.tenant = tenant; this.application = application; @@ -38,11 +45,11 @@ public class LoadBalancer { return instance; } - public String cluster() { + public ClusterSpec.Id cluster() { return cluster; } - public String hostname() { + public HostName hostname() { return hostname; } } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java index aca7562df6f..06599aa0b82 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.UUID; import java.util.stream.Collectors; /** @@ -24,7 +25,7 @@ public class MemoryNameService implements NameService { @Override public RecordId createCname(RecordName alias, RecordData canonicalName) { - RecordId id = new RecordId(alias.asString()); + RecordId id = new RecordId(UUID.randomUUID().toString()); records.put(id, new Record(id, Record.Type.CNAME, alias, canonicalName)); return id; } |