Represents the environment in which elections are run on behalf of a node. There is exactly one instance of an Elections for each node. Elections are initiated via this class. One of the primary goals of this interface is to keep Elections as free standing as possible, so that we can change how elections are held, or aspects of the election infrastructure with minimal impact on replication. For example, elections currently used tcp for communication of election messages but may want to switch over to udp. Such a change should be confined to just the Elections module. Other changes might include changes to the strategy used to suggest Values and the weight associated with a suggested Value. The following are the principal points of interaction between Elections and Replication: 1) The initiation of elections via the initiateElections() method. 2) The suggestion of nodes as masters and the ranking of the suggestion. This is done via the Acceptor.SuggestionGenerator interface. An instance of this interface is supplied when the Elections class is instantiated. Note that the implementation must also initiate a freeze of VLSNs to ensure that the ranking does not change as the election progresses. The VLSN can make progress when the node is informed via its Listener that an election with a higher Proposal number (than the one in the Propose request) has finished. 3) Obtaining the result of an election initiated in step 1. This is done via the Learner.Listener interface. An instance of this class is supplied when the Election class is first instantiated.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.