blob: ea8ae6820c9bc2008e010fcfaaf2f0b92cd5f1bb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.routing;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.zone.ZoneId;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import java.util.Objects;
/**
* Unique identifier for a {@link RoutingPolicy}.
*
* @author mpolden
*/
public record RoutingPolicyId(ApplicationId owner, ClusterSpec.Id cluster, ZoneId zone) {
public RoutingPolicyId {
Objects.requireNonNull(owner, "owner must be non-null");
Objects.requireNonNull(cluster, "cluster must be non-null");
Objects.requireNonNull(zone, "zone must be non-null");
}
/** The deployment this applies to */
public DeploymentId deployment() {
return new DeploymentId(owner, zone);
}
@Override
public String toString() {
return "routing policy for " + cluster + ", in " + zone + ", owned by " + owner;
}
}
|