aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ApplicationPatch.java
blob: 4bfd592443b9641428c9451834f38d41cb47b09f (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.noderepository;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Patchable data under Application
 *
 * @author bratseth
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ApplicationPatch {

    @JsonProperty("currentReadShare")
    public Double currentReadShare;

    @JsonProperty("maxReadShare")
    public Double maxReadShare;

    @JsonProperty("clusters")
    public Map<String, ClusterPatch> clusters = new LinkedHashMap<>();

    public static class ClusterPatch {

        @JsonProperty("bcpGroupInfo")
        public BcpGroupInfo bcpGroupInfo;

        public ClusterPatch(BcpGroupInfo bcpGroupInfo) {
            this.bcpGroupInfo = bcpGroupInfo;
        }

    }

    public static class BcpGroupInfo {

        @JsonProperty("queryRate")
        public Double queryRate;

        @JsonProperty("growthRateHeadroom")
        public Double growthRateHeadroom;

        @JsonProperty("cpuCostPerQuery")
        public Double cpuCostPerQuery;

        public BcpGroupInfo(@JsonProperty("queryRate")double queryRate,
                            @JsonProperty("growthRateHeadroom")double growthRateHeadroom,
                            @JsonProperty("cpuCostPerQuery")double cpuCostPerQuery) {
            this.queryRate = queryRate;
            this.growthRateHeadroom = growthRateHeadroom;
            this.cpuCostPerQuery = cpuCostPerQuery;
        }

    }

}