abstract class Round
extends java.lang.Object
In Raft a log entry represents a state transition at a specific index in the replicated log. The leader can only append log entries to the log.
In Ketch a log entry is recorded under the refs/txn namespace. This
occurs when:
ElectionRound)
Proposals
(see ProposalRound)
| Modifier and Type | Field and Description |
|---|---|
(package private) LogIndex |
acceptedNewIndex |
(package private) LogIndex |
acceptedOldIndex |
(package private) KetchLeader |
leader |
(package private) java.util.List<ReceiveCommand> |
stageCommands |
| Constructor and Description |
|---|
Round(KetchLeader leader,
LogIndex head) |
| Modifier and Type | Method and Description |
|---|---|
(package private) KetchSystem |
getSystem() |
(package private) void |
runAsync(AnyObjectId newId)
Asynchronously distribute the round's new value for
refs/txn/accepted to all replicas. |
(package private) abstract void |
start()
Creates a commit for
refs/txn/accepted and calls
runAsync(AnyObjectId) to begin execution of the round across
the system. |
(package private) abstract void |
success()
Notify the round it was accepted by a majority of the system.
|
final KetchLeader leader
final LogIndex acceptedOldIndex
LogIndex acceptedNewIndex
java.util.List<ReceiveCommand> stageCommands
Round(KetchLeader leader, LogIndex head)
KetchSystem getSystem()
abstract void start()
throws java.io.IOException
refs/txn/accepted and calls
runAsync(AnyObjectId) to begin execution of the round across
the system.
If references are being updated (such as in a ProposalRound) the
RefTree may be modified.
Invoked without KetchLeader.lock to build objects.
java.io.IOException - the round cannot build new objects within the leader's
repository. The leader may be unable to execute.void runAsync(AnyObjectId newId)
refs/txn/accepted to all replicas.
Invoked by start() after new commits have been created for the
log. The method passes newId to KetchLeader to be
distributed to all known replicas.
newId - new value for refs/txn/accepted.abstract void success()
Invoked by the leader with KetchLeader.lock held by the caller.