summaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterInfo.java
blob: dc01c37f854c5e3e77ca9fde8b9a0100d83ad147 (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
package com.yahoo.config.provision;

import java.time.Duration;

/**
 * Auxiliary information about a cluster, provided by the config model to the node repo during a
 * capacity request.
 *
 * @author bratseth
 */
public class ClusterInfo {

    private static final ClusterInfo empty = new ClusterInfo.Builder().build();

    private final Duration bcpDeadline;

    private ClusterInfo(Builder builder) {
        this.bcpDeadline = builder.bcpDeadline;
    }

    public Duration bcpDeadline() { return bcpDeadline; }

    public static ClusterInfo empty() { return empty; }

    public static class Builder {

        private Duration bcpDeadline = Duration.ofMinutes(0);

        public Builder bcpDeadline(Duration duration) {
            this.bcpDeadline = duration;
            return this;
        }

        public ClusterInfo build() {
            return new ClusterInfo(this);
        }

    }

}