2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.raft;
10 import scala.concurrent.duration.FiniteDuration;
13 * Configuration Parameter interface for configuring the Raft consensus system
15 * Any component using this implementation might want to provide an implementation of
16 * this interface to configure
18 * A default implementation will be used if none is provided.
20 * @author Kamal Rameshan
22 public interface ConfigParams {
24 * The minimum number of entries to be present in the in-memory Raft log
25 * for a snapshot to be taken
29 long getSnapshotBatchCount();
32 * The percentage of total memory in the in-memory Raft log before a snapshot
37 int getSnapshotDataThresholdPercentage();
40 * The interval at which a heart beat message will be sent to the remote
43 * @return FiniteDuration
45 FiniteDuration getHeartBeatInterval();
48 * The interval in which a new election would get triggered if no leader is found
50 * Normally its set to atleast twice the heart beat interval
52 * @return FiniteDuration
54 FiniteDuration getElectionTimeOutInterval();
57 * The maximum election time variance. The election is scheduled using both
58 * the Election Timeout and Variance
62 int getElectionTimeVariance();
65 * The size (in bytes) of the snapshot chunk sent from Leader
67 int getSnapshotChunkSize();
70 * The number of journal log entries to batch on recovery before applying.
72 int getJournalRecoveryLogBatchSize();
75 * The interval in which the leader needs to check itself if its isolated
76 * @return FiniteDuration
78 long getIsolatedCheckIntervalInMillis();
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.
85 long getElectionTimeoutFactor();