|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.elections.TimebasedProposalGenerator
public class TimebasedProposalGenerator
Generates a unique sequence of ascending proposal numbers that is unique across all machines. Each proposal number is built as the catenation of the following components: ms time (8 bytes) | IP address (16 bytes) | locally unique Id (4 bytes) The ms time supplies the increasing number and the IP address a number unique across machines.
Field Summary | |
---|---|
(package private) static int |
ADDRESS_WIDTH
|
(package private) static int |
TIME_WIDTH
|
(package private) static int |
UID_WIDTH
|
(package private) static int |
uniqueIdGenerator
|
Constructor Summary | |
---|---|
TimebasedProposalGenerator()
Constructor defaulting the unique id so it's merely unique within the process. |
|
TimebasedProposalGenerator(int locallyUniqueId)
Creates an instance with an application-specified locally (machine wide) unique id, e.g. |
Method Summary | |
---|---|
static Proposer.ProposalParser |
getParser()
Returns the parser used to convert wire representations into Proposal instances. |
Proposer.Proposal |
nextProposal()
Returns the next Proposal greater than all previous proposals returned on this machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static int uniqueIdGenerator
static final int TIME_WIDTH
static final int ADDRESS_WIDTH
static final int UID_WIDTH
Constructor Detail |
---|
TimebasedProposalGenerator(int locallyUniqueId)
locallyUniqueId
- the machine wide unique idpublic TimebasedProposalGenerator()
Method Detail |
---|
public Proposer.Proposal nextProposal()
public static Proposer.ProposalParser getParser()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |