blob: f3360d1b8d2dfa4db48d0be9a729fe1131f348e5 (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.cluster;
/**
* The configuration of a cluster monitor instance
*
* @author bratseth
* @author Steinar Knutsen
*/
public class MonitorConfiguration {
/**
* The interval in ms between consecutive checks of the monitored nodes
*/
private final long checkInterval = 1000;
/**
* The number of milliseconds to attempt to complete a request before giving
* up
*/
private long requestTimeout = 2700;
public MonitorConfiguration(final QrMonitorConfig config) {
requestTimeout = config.requesttimeout();
}
/**
* Returns the interval between each ping of idle or failing nodes Default
* is 1000ms
*/
public long getCheckInterval() {
return checkInterval;
}
/**
* Sets the number of milliseconds to attempt to service a request (at
* different nodes) before giving up.
*/
public void setRequestTimeout(final long timeout) {
requestTimeout = timeout;
}
/**
* Returns the number of milliseconds to attempt to service a request (at
* different nodes) before giving up. Default is 2700 ms.
*/
public long getRequestTimeout() {
return requestTimeout;
}
}
|