Package com.tangosol.net
Class ConfigurableQuorumPolicy.MembershipQuorumPolicy
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.ConfigurableQuorumPolicy
com.tangosol.net.ConfigurableQuorumPolicy.MembershipQuorumPolicy
- All Implemented Interfaces:
ActionPolicy
- Direct Known Subclasses:
ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy
,ConfigurableQuorumPolicy.ProxyQuorumPolicy
- Enclosing class:
ConfigurableQuorumPolicy
public abstract static class ConfigurableQuorumPolicy.MembershipQuorumPolicy
extends ConfigurableQuorumPolicy
MembershipQuorumPolicy is a quorum policy that is stateless and based
solely on service membership sizes. MembershipQuorumPolicy uses a
state-machine that encodes the allowable Actions, and uses MemberEvents to
maintain the state-machine as the service membership changes.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
QuorumListener is used to subscribe the quorum policy to receive service membership events.static class
A quorum rule defines a set of allowable actions beyond the rule's threshold size.Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicy
ConfigurableQuorumPolicy.ClusterQuorumPolicy, ConfigurableQuorumPolicy.MembershipQuorumPolicy, ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicy
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Create a MembershipQuorumPolicy. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configure and initialize this policy with the specified quorum rules.Return the current quorum rule used by the policy.protected Set
Return the set of members that are leaving the associated serviceprotected int
Calculate and return the current size of the member set that contributes to the quorum for this policy domain.Return the quorum rules used by this policy.getRule
(int nMask) Return the quorum rule for the specified mask.Return the Service which this policy applies to.void
Called when the specified service loads and configures this policy.protected MemberListener
Instantiate a member listener to subscribe to service membership events.protected void
Set the current quorum rule used by the policy.protected void
Set the quorum rules used by this policy.protected void
setService
(Service service) Set the service that this policy applies to.toString()
Return a human-readable String representation of this ActionPolicy.protected void
Update the currently applicable quorum rule, possibly changing it to reflect growth or shrinkage of the membership size.Methods inherited from class com.tangosol.net.ConfigurableQuorumPolicy
getStatusDescription, instantiateClusterPolicy, instantiatePartitionedCachePolicy, instantiateProxyPolicy
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tangosol.net.ActionPolicy
isAllowed
-
Field Details
-
m_setLeaving
The set of leaving members. -
m_service
The Service that this policy applies to. -
m_ruleCurrent
The current state. -
m_aRules
The array of quorum rules.
-
-
Constructor Details
-
MembershipQuorumPolicy
protected MembershipQuorumPolicy()Create a MembershipQuorumPolicy.
-
-
Method Details
-
getService
Return the Service which this policy applies to.- Returns:
- the Service which this policy applies to
-
setService
Set the service that this policy applies to.- Parameters:
service
- the Service that this policy applies to
-
getCurrentRule
Return the current quorum rule used by the policy.- Returns:
- the current quorum rule used by the policy
-
getRule
Return the quorum rule for the specified mask.- Parameters:
nMask
- the mask- Returns:
- the quorum rule for the specified mask
-
setCurrentRule
protected void setCurrentRule(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ruleCurrent) Set the current quorum rule used by the policy.- Parameters:
ruleCurrent
- the current quorum rule used by the policy
-
setQuorumRules
Set the quorum rules used by this policy.- Parameters:
aRule
- the quorum rules used by this policy
-
getQuorumRules
Return the quorum rules used by this policy.- Returns:
- the quorum rules used by this policy
-
getLeavingMembers
Return the set of members that are leaving the associated service- Returns:
- the set of members that are leaving the associated service
-
getPolicyPopulation
protected int getPolicyPopulation()Calculate and return the current size of the member set that contributes to the quorum for this policy domain.- Returns:
- the current size
-
configure
Configure and initialize this policy with the specified quorum rules.- Parameters:
aRule
- the array of quorum rules to configure for this policy
-
updateCurrentRule
protected void updateCurrentRule()Update the currently applicable quorum rule, possibly changing it to reflect growth or shrinkage of the membership size. -
init
Called when the specified service loads and configures this policy.Note: A policy could be applied to multiple services.
- Parameters:
service
- the service that this policy applies to
-
toString
Return a human-readable String representation of this ActionPolicy.Note: this method may be used to provide information about this ActionPolicy to management interfaces.
- Specified by:
toString
in interfaceActionPolicy
- Overrides:
toString
in classObject
-
instantiateMemberListener
Instantiate a member listener to subscribe to service membership events.- Returns:
- a member listener
-