Package org.eclipse.jgit.internal.ketch
Class ProposalRound
- java.lang.Object
-
- org.eclipse.jgit.internal.ketch.Round
-
- org.eclipse.jgit.internal.ketch.ProposalRound
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ProposalRound.NoOp
-
Field Summary
Fields Modifier and Type Field Description private RefTree
queuedTree
private java.util.List<Proposal>
todo
-
Fields inherited from class org.eclipse.jgit.internal.ketch.Round
acceptedNewIndex, acceptedOldIndex, leader, stageCommands
-
-
Constructor Summary
Constructors Constructor Description ProposalRound(KetchLeader leader, LogIndex head, java.util.List<Proposal> todo, RefTree tree)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
abort()
private void
blockUntil(ProposedTimestamp ts)
private static boolean
canCombine(java.util.List<Proposal> todo)
private static boolean
canCombine(Proposal a, Proposal b)
private static boolean
canCombine(PersonIdent a, PersonIdent b)
private ObjectId
insertMultiProposal(Repository git, ProposedTimestamp ts, ObjectInserter inserter)
private ObjectId
insertProposals(Repository git, ProposedTimestamp ts)
private ObjectId
insertSingleProposal(Repository git, ProposedTimestamp ts, ObjectInserter inserter)
private java.util.List<ReceiveCommand>
makeStageList(Repository git, ObjectInserter inserter)
private java.lang.String
message(Proposal p)
private static java.lang.String
nullToEmpty(java.lang.String str)
(package private) void
start()
Creates a commit forrefs/txn/accepted
and callsRound.runAsync(AnyObjectId)
to begin execution of the round across the system.(package private) void
success()
Notify the round it was accepted by a majority of the system.
-
-
-
Constructor Detail
-
ProposalRound
ProposalRound(KetchLeader leader, LogIndex head, java.util.List<Proposal> todo, @Nullable RefTree tree)
-
-
Method Detail
-
canCombine
private static boolean canCombine(java.util.List<Proposal> todo)
-
nullToEmpty
private static java.lang.String nullToEmpty(@Nullable java.lang.String str)
-
canCombine
private static boolean canCombine(@Nullable PersonIdent a, @Nullable PersonIdent b)
-
start
void start() throws java.io.IOException
Description copied from class:Round
Creates a commit forrefs/txn/accepted
and callsRound.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.
-
insertProposals
private ObjectId insertProposals(Repository git, ProposedTimestamp ts) throws java.io.IOException, ProposalRound.NoOp
- Throws:
java.io.IOException
ProposalRound.NoOp
-
insertSingleProposal
private ObjectId insertSingleProposal(Repository git, ProposedTimestamp ts, ObjectInserter inserter) throws java.io.IOException, ProposalRound.NoOp
- Throws:
java.io.IOException
ProposalRound.NoOp
-
insertMultiProposal
private ObjectId insertMultiProposal(Repository git, ProposedTimestamp ts, ObjectInserter inserter) throws java.io.IOException, ProposalRound.NoOp
- Throws:
java.io.IOException
ProposalRound.NoOp
-
message
private java.lang.String message(Proposal p)
-
abort
void abort()
-
success
void success()
Description copied from class:Round
Notify the round it was accepted by a majority of the system.Invoked by the leader with
KetchLeader.lock
held by the caller.
-
makeStageList
private java.util.List<ReceiveCommand> makeStageList(Repository git, ObjectInserter inserter) throws java.io.IOException
- Throws:
java.io.IOException
-
blockUntil
private void blockUntil(ProposedTimestamp ts) throws TimeIsUncertainException
- Throws:
TimeIsUncertainException
-
-