public interface QuorumMember<S extends Remote> extends QuorumClient<S>, QuorumStateChangeListener
UUID
of the member service and can report on its role and relationships in the
Quorum
. In order to act on the distributed quorum state, the
QuorumMember
will issue various commands to its QuorumActor
.
This interface defines a collection of messages which are used to inform the
QuorumMember
of significant changes in the distributed quorum state
as it pertains to this quorum member. See QuorumStateChangeListener
.
Modifier and Type | Method and Description |
---|---|
void |
assertLeader(long token)
Assert that this is the quorum leader.
|
QuorumActor<S,QuorumMember<S>> |
getActor()
Return the actor for this
QuorumMember . |
UUID |
getDownstreamServiceId()
Return the
UUID of the service (if any) downstream from this
service in the write pipeline. |
ExecutorService |
getExecutor()
An
ExecutorService which may be used by the QuorumMember
to run various asynchronous tasks. |
S |
getService()
Return the local service implementation object (NOT the RMI proxy for
that object).
|
UUID |
getServiceId()
The identifier for this service (the quorum member).
|
boolean |
isFollower(long token)
Return
true iff this node is a quorum follower. |
boolean |
isJoinedMember(long token)
Return
true if the service is joined with the quorum. |
boolean |
isLastInChain(long token)
Return
true iff the quorum is highly available and this
node is last one in the write pipeline (it will not return true for a
singleton quorum where the only node is the master). |
boolean |
isLeader(long token)
Return
true iff this node is the quorum leader. |
boolean |
isMember()
Return
true if the quorum recognizes the service as a member
of that quorum. |
boolean |
isPipelineMember()
Return
true if quorum recognizes the service is part of the
write pipeline. |
disconnected, getLeader, getLogicalServiceZPath, getQuorum, getService, start, terminate
notify
consensus, lostConsensus, memberAdd, memberRemove, pipelineAdd, pipelineChange, pipelineElectedLeader, pipelineRemove, pipelineUpstreamChange, quorumBreak, quorumMeet, serviceJoin, serviceLeave
UUID getServiceId()
S getService()
A service operating as a QuorumMember
has both Remote
interface and a non-remote interface. These interfaces typically define
similar methods (for example, compare HACommitGlue
, which is
Remote
, with QuorumCommit
, which is non-remote). The
Remote
interface in turn will have a local implementation object
inside of the JVM and an exported proxy for that Remote
interface. This method returns the local implementation object
for the Remote
interface and is intended to facilitate operations
which the QuorumMember
executes against its own Remote
interface. While the Remote
interface will be exposed to other
services using a proxy, how that happens is outside of the scope of this
method.
ExecutorService getExecutor()
ExecutorService
which may be used by the QuorumMember
to run various asynchronous tasks.QuorumActor<S,QuorumMember<S>> getActor()
QuorumMember
.boolean isMember()
true
if the quorum recognizes the service as a member
of that quorum. The quorum token is not required for this method because
membership status does not change with a quorum meet or break.boolean isPipelineMember()
true
if quorum recognizes the service is part of the
write pipeline. The quorum token is not required for this method because
pipeline status does not change with a quorum meet or break. Once a
service is receiving synchronous messages from a Quorum
it will
notice when it enters and leaves the pipeline and when the downstream
service for this service changes in the quorum.boolean isLastInChain(long token)
true
iff the quorum is highly available and this
node is last one in the write pipeline (it will not return true for a
singleton quorum where the only node is the master).token
- The quorum token for which the request was made.boolean isJoinedMember(long token)
true
if the service is joined with the quorum.
Note: This method DOES NOT throw an exception if the quorum is not met,
but it will not return true
unless the quorum is met.
token
- The quorum token for which the request was made.boolean isLeader(long token)
true
iff this node is the quorum leader. The
quorum leader is the only node which will accept writes. Note that is
always true
when the #replicationFactor()
is ONE
(1).token
- The quorum token for which the request was made.boolean isFollower(long token)
true
iff this node is a quorum follower. This is
true
of all nodes in a Q
except for the leader.token
- The quorum token for which the request was made.void assertLeader(long token)
token
- The quorum token for which the request was made.QuorumException
- if the quorum is not metQuorumException
- if the caller's token is not the current quorum token.QuorumException
- if this is not the quorum leader.UUID getDownstreamServiceId()
UUID
of the service (if any) downstream from this
service in the write pipeline.null
for services which are not part of
the write pipeline, for the leader, and for the last service in
the write pipeline.QuorumException
- if the quorum token is no longer valid.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.