BUG-2187: Non voting and Uninitialized followers are not to be counted towards consensus
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / policy / DisableElectionsRaftPolicy.java
1 /*
2  * Copyright (c) 2015 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
9 package org.opendaylight.controller.cluster.raft.policy;
10
11 /**
12  * DisableElectionsRaftPolicy can be useful for testing purposes where we may want to disable
13  * elections so that the Leaders for a RaftActor can be set externally. Modification to state would
14  * still require consensus.
15  */
16 public class DisableElectionsRaftPolicy implements RaftPolicy {
17     @Override
18     public boolean automaticElectionsEnabled() {
19         return false;
20     }
21
22     @Override
23     public boolean applyModificationToStateBeforeConsensus() {
24         return false;
25     }
26 }