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 org.opendaylight.controller.cluster.raft.policy.RaftPolicy;
11 import scala.concurrent.duration.FiniteDuration;
14 * Configuration Parameter interface for configuring the Raft consensus system
16 * Any component using this implementation might want to provide an implementation of
17 * this interface to configure
19 * A default implementation will be used if none is provided.
21 * @author Kamal Rameshan
23 public interface ConfigParams {
25 * The minimum number of entries to be present in the in-memory Raft log
26 * for a snapshot to be taken
30 long getSnapshotBatchCount();
33 * The percentage of total memory in the in-memory Raft log before a snapshot
38 int getSnapshotDataThresholdPercentage();
41 * The interval at which a heart beat message will be sent to the remote
44 * @return FiniteDuration
46 FiniteDuration getHeartBeatInterval();
49 * The interval in which a new election would get triggered if no leader is found
51 * Normally its set to atleast twice the heart beat interval
53 * @return FiniteDuration
55 FiniteDuration getElectionTimeOutInterval();
58 * The maximum election time variance. The election is scheduled using both
59 * the Election Timeout and Variance
63 int getElectionTimeVariance();
66 * The size (in bytes) of the snapshot chunk sent from Leader
68 int getSnapshotChunkSize();
71 * The number of journal log entries to batch on recovery before applying.
73 int getJournalRecoveryLogBatchSize();
76 * The interval in which the leader needs to check itself if its isolated
77 * @return FiniteDuration
79 long getIsolatedCheckIntervalInMillis();
83 * The multiplication factor to be used to determine shard election timeout. The election timeout
84 * is determined by multiplying the election timeout factor with the heartbeat duration.
86 long getElectionTimeoutFactor();
91 * @return An instance of org.opendaylight.controller.cluster.raft.policy.RaftPolicy or an instance of the
94 RaftPolicy getRaftPolicy();