Class DefaultRaftPolicy
- java.lang.Object
-
- org.opendaylight.controller.cluster.raft.policy.DefaultRaftPolicy
-
- All Implemented Interfaces:
RaftPolicy
public class DefaultRaftPolicy extends Object implements RaftPolicy
-
-
Field Summary
Fields Modifier and Type Field Description static RaftPolicy
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultRaftPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applyModificationToStateBeforeConsensus()
According to Raft consensus on a Raft entry is achieved only after a Leader replicates a log entry to a majority of it's followers.boolean
automaticElectionsEnabled()
According to Raft a Follower which does not receive a heartbeat (aka AppendEntries) in a given period should become a Candidate and trigger an election.
-
-
-
Field Detail
-
INSTANCE
public static final RaftPolicy INSTANCE
-
-
Method Detail
-
automaticElectionsEnabled
public boolean automaticElectionsEnabled()
Description copied from interface:RaftPolicy
According to Raft a Follower which does not receive a heartbeat (aka AppendEntries) in a given period should become a Candidate and trigger an election.- Specified by:
automaticElectionsEnabled
in interfaceRaftPolicy
- Returns:
- true to enable automatic Raft elections, false to disable them
-
applyModificationToStateBeforeConsensus
public boolean applyModificationToStateBeforeConsensus()
Description copied from interface:RaftPolicy
According to Raft consensus on a Raft entry is achieved only after a Leader replicates a log entry to a majority of it's followers.- Specified by:
applyModificationToStateBeforeConsensus
in interfaceRaftPolicy
- Returns:
- true if modification should be applied before consensus, false to apply modification to state as per Raft
-
-