summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/cluster/MonitorConfiguration.java
blob: 95f51b374d6aa3542cb59f16901718af434952d8 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.cluster;

/**
 * The configuration of a cluster monitor instance
 *
 * @author bratseth
 */
public class MonitorConfiguration  {

    /** The interval in ms between consecutive checks of the monitored nodes */
    private long checkInterval = 1000;

    /** The number of milliseconds to attempt to complete a request before giving up */
    private final long requestTimeout = 980;

    /** The number of milliseconds a node is allowed to fail before we mark it as not working */
    private long failLimit = 5000;

    /** Sets the interval between each ping of idle or failing nodes. Default is 1000 ms. */
    @Deprecated // TODO: Remove on Vespa 8
    public void setCheckInterval(long intervalMs) { this.checkInterval = intervalMs; }

    /** Returns the interval between each ping of idle or failing nodes. Default is 1000 ms. */
    public long getCheckInterval() { return checkInterval; }

    /**
     * Sets the number of times a failed node must respond before it is put  back in service. Default is 3.
     *
     * @deprecated will go away in Vespa 8
     */
    @Deprecated // TODO: Remove on Vespa 8
    public void setResponseAfterFailLimit(int responseAfterFailLimit) { }

    /**
     * Sets the number of ms a node (failing or working) is allowed to stay idle before it is pinged. Default is 3000.
     *
     * @deprecated Will go away in Vespa 8
     */
    @Deprecated // TODO: Remove on Vespa 8
    public void setIdleLimit(int idleLimit) { }

    /**
     * Gets the number of ms a node (failing or working) is allowed to stay idle before it is pinged. Default is 3000.
     *
     * @deprecated Will go away in Vespa 8
     */
    @Deprecated // TODO: Remove on Vespa 8
    public long getIdleLimit() {
        return 3000;
    }

    /**
     * Returns the number of milliseconds to attempt to service a request
     * (at different nodes) before giving up. Default is 5000 ms.
     */
    public long getRequestTimeout() { return requestTimeout; }

    /**
     * Sets the number of milliseconds a node is allowed to fail before we
     * mark it as not working
     */
    @Deprecated // TODO: Remove on Vespa 8
    public void setFailLimit(long failLimit) { this.failLimit=failLimit; }

    /**
     * Returns the number of milliseconds a node is allowed to fail before we
     * mark it as not working
     */
    public long getFailLimit() { return failLimit; }

    /**
     * The number of times a node must fail in one hour to be placed
     * in quarantine.  Once in quarantine it won't be put back in
     * productuion before quarantineTime has expired even if it is
     * working. Default is 3
     *
     * @deprecated Will go away in Vespa 8
     */
    @Deprecated // TODO: Remove on Vespa 8
    public void setFailQuarantineLimit(int failQuarantineLimit) { }

    /**
     * The number of ms an unstable node is quarantined. Default is 100*60*60
     *
     * @deprecated Will go away in Vespa 8
     */
    @Deprecated // TODO: Remove on Vespa 8
    public void setQuarantineTime(long quarantineTime) { }

    @Override
    public String toString() {
        return "monitor configuration [" +
               "checkInterval: " + checkInterval +
               " requestTimeout " + requestTimeout +
               " failLimit " + failLimit +
               "]";
    }

}