Install snapshot and Reply
[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     public long getSnapshotBatchCount();
30
31     /**
32      * The interval at which a heart beat message will be sent to the remote
33      * RaftActor
34      *
35      * @return FiniteDuration
36      */
37     public FiniteDuration getHeartBeatInterval();
38
39     /**
40      * The interval in which a new election would get triggered if no leader is found
41      *
42      * Normally its set to atleast twice the heart beat interval
43      *
44      * @return FiniteDuration
45      */
46     public FiniteDuration getElectionTimeOutInterval();
47
48     /**
49      * The maximum election time variance. The election is scheduled using both
50      * the Election Timeout and Variance
51      *
52      * @return int
53      */
54     public int getElectionTimeVariance();
55
56     /**
57      * The size (in bytes) of the snapshot chunk sent from Leader
58      */
59     public int getSnapshotChunkSize();
60 }