Merge "Added sun.misc to jre.properties"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / ConfigParams.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.raft;
9
10 import scala.concurrent.duration.FiniteDuration;
11
12 /**
13  * Configuration Parameter interface for configuring the Raft consensus system
14  * <p/>
15  * Any component using this implementation might want to provide an implementation of
16  * this interface to configure
17  *
18  * A default implementation will be used if none is provided.
19  *
20  * @author Kamal Rameshan
21  */
22 public interface ConfigParams {
23     /**
24      * The minimum number of entries to be present in the in-memory Raft log
25      * for a snapshot to be taken
26      *
27      * @return long
28      */
29     long getSnapshotBatchCount();
30
31     /**
32      * The percentage of total memory in the in-memory Raft log before a snapshot
33      * is to be taken
34      *
35      * @return int
36      */
37     int getSnapshotDataThresholdPercentage();
38
39     /**
40      * The interval at which a heart beat message will be sent to the remote
41      * RaftActor
42      *
43      * @return FiniteDuration
44      */
45     FiniteDuration getHeartBeatInterval();
46
47     /**
48      * The interval in which a new election would get triggered if no leader is found
49      *
50      * Normally its set to atleast twice the heart beat interval
51      *
52      * @return FiniteDuration
53      */
54     FiniteDuration getElectionTimeOutInterval();
55
56     /**
57      * The maximum election time variance. The election is scheduled using both
58      * the Election Timeout and Variance
59      *
60      * @return int
61      */
62     int getElectionTimeVariance();
63
64     /**
65      * The size (in bytes) of the snapshot chunk sent from Leader
66      */
67     int getSnapshotChunkSize();
68
69     /**
70      * The number of journal log entries to batch on recovery before applying.
71      */
72     int getJournalRecoveryLogBatchSize();
73
74     /**
75      * The interval in which the leader needs to check itself if its isolated
76      * @return FiniteDuration
77      */
78     FiniteDuration getIsolatedCheckInterval();
79
80
81     /**
82      * The multiplication factor to be used to determine shard election timeout. The election timeout
83      * is determined by multiplying the election timeout factor with the heartbeat duration.
84      */
85     long getElectionTimeoutFactor();
86
87 }