public class QuorumCommitImpl<S extends HACommitGlue> extends QuorumStateChangeListenerBase implements QuorumCommit<S>, QuorumStateChangeListener, ServiceLookup<HACommitGlue>
|Constructor and Description|
|Modifier and Type||Method and Description|
Used by the leader to send a message to each service joined with the quorum telling it to discard its write set, reloading all state from the last root block.
Used by the leader to send a message to each joined service in the quorum telling it to commit using the root block from the corresponding
Return the remote interface used to perform HA operations on a member of quorum.
Used by the leader to send a message to each joined service in the quorum instructing it to flush all writes to the backing channel, and acknowledge "yes" if ready to commit.
consensus, lostConsensus, memberAdd, memberRemove, pipelineAdd, pipelineChange, pipelineElectedLeader, pipelineRemove, pipelineUpstreamChange, quorumBreak, quorumMeet, serviceJoin, serviceLeave
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public HACommitGlue getService(UUID serviceId)
public PrepareResponse prepare2Phase(PrepareRequest req) throws InterruptedException, IOException
This implementation runs the operation on the leader in the caller's thread to avoid deadlock. The other services run the operation asynchronously on their side while the leader awaits their future's using get().
IHA2PhasePrepareMessage is sent to all services in
write pipeline. This ensures that services that are not yet joined with
the met quorum will still observe the root blocks. This is necessary in
order for them to catch up with the met quorum. The 2-phase commit
protocol is "aware" that not all messages are being sent to services
whose votes count. Only services that are actually in the met quorum get
Note: This method is responsible for the atomic decision regarding
whether a service will be considered to be "joined" with the met quorum
for the 2-phase commit. A service that is synchronizing will either have
already voted the appropriate lastCommitTime and entered the met quorum
or it will not. That decision point is captured atomically when we obtain
a snapshot of the joined services from the quorum state. The decision is
propagated through the
IHA2PhasePrepareMessage and that
information is retained by the service together with the new root block
from the prepare message. This metadata is used to decide how the service
will handle the prepare, commit, and abort messages.
public CommitResponse commit2Phase(CommitRequest commitRequest) throws IOException, InterruptedException
preparemessage. The commit MAY NOT go forward unless both the current quorum token and the lastCommitTime on this message agree with the quorum token and lastCommitTime in the root block from the last "prepare" message.
public void abort2Phase(long token) throws IOException, InterruptedException
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.