public class QuorumImpl extends Object implements Quorum
QuorumImpl
can be used to notify quorum service for a particular quorum result that originated externally.Constructor and Description |
---|
QuorumImpl(QuorumConfig config,
NodeEngineImpl nodeEngine) |
Modifier and Type | Method and Description |
---|---|
void |
ensureQuorumPresent(Operation op)
Ensures that the quorum is present for the given operation.
|
QuorumConfig |
getConfig() |
String |
getName() |
int |
getSize() |
boolean |
isInitialized() |
boolean |
isPresent()
Returns true if quorum is present, false if absent.
|
void |
setLocalResult(boolean presence)
Sets the current quorum presence to the given
presence and marks the instance as initialized. |
String |
toString() |
void |
update(Collection<Member> members)
Determines if the quorum is present for the given member collection, caches the result and publishes an event under
the
quorumName topic if there was a change in presence. |
public QuorumImpl(QuorumConfig config, NodeEngineImpl nodeEngine)
public void update(Collection<Member> members)
quorumName
topic if there was a change in presence.members
- the members for which the presence is determinedpublic String getName()
public int getSize()
public QuorumConfig getConfig()
public boolean isInitialized()
public boolean isPresent()
Quorum
public void setLocalResult(boolean presence)
presence
and marks the instance as initialized.presence
- the quorum presence to be setpublic void ensureQuorumPresent(Operation op)
quorumName
topic
if membership changed after determining the quorum presence.op
- the operation for which the quorum should be presentQuorumException
- if the operation requires a quorum and the quorum is not presentCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.