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
Nested Classes Modifier and Type Class Description protected classConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumListenerQuorumListener is used to subscribe the quorum policy to receive service membership events.static classConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRuleA 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
Fields Modifier and Type Field Description protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[]m_aRulesThe array of quorum rules.protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRulem_ruleCurrentThe current state.protected Servicem_serviceThe Service that this policy applies to.protected Setm_setLeavingThe set of leaving members.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMembershipQuorumPolicy()Create a MembershipQuorumPolicy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)Configure and initialize this policy with the specified quorum rules.protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRulegetCurrentRule()Return the current quorum rule used by the policy.protected SetgetLeavingMembers()Return the set of members that are leaving the associated serviceprotected intgetPolicyPopulation()Calculate and return the current size of the member set that contributes to the quorum for this policy domain.protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[]getQuorumRules()Return the quorum rules used by this policy.protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRulegetRule(int nMask)Return the quorum rule for the specified mask.ServicegetService()Return the Service which this policy applies to.voidinit(Service service)Called when the specified service loads and configures this policy.protected MemberListenerinstantiateMemberListener()Instantiate a member listener to subscribe to service membership events.protected voidsetCurrentRule(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ruleCurrent)Set the current quorum rule used by the policy.protected voidsetQuorumRules(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)Set the quorum rules used by this policy.protected voidsetService(Service service)Set the service that this policy applies to.StringtoString()Return a human-readable String representation of this ActionPolicy.protected voidupdateCurrentRule()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, newHashMap, newHashMap, newHashSet, newHashSet, 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 Detail
-
m_setLeaving
protected Set m_setLeaving
The set of leaving members.
-
m_service
protected Service m_service
The Service that this policy applies to.
-
m_ruleCurrent
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule m_ruleCurrent
The current state.
-
m_aRules
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] m_aRules
The array of quorum rules.
-
-
Method Detail
-
getService
public Service getService()
Return the Service which this policy applies to.- Returns:
- the Service which this policy applies to
-
setService
protected void setService(Service service)
Set the service that this policy applies to.- Parameters:
service- the Service that this policy applies to
-
getCurrentRule
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule getCurrentRule()
Return the current quorum rule used by the policy.- Returns:
- the current quorum rule used by the policy
-
getRule
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule getRule(int nMask)
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
protected void setQuorumRules(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
Set the quorum rules used by this policy.- Parameters:
aRule- the quorum rules used by this policy
-
getQuorumRules
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] getQuorumRules()
Return the quorum rules used by this policy.- Returns:
- the quorum rules used by this policy
-
getLeavingMembers
protected Set 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
protected void configure(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
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
public void init(Service service)
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
public String 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:
toStringin interfaceActionPolicy- Overrides:
toStringin classObject
-
instantiateMemberListener
protected MemberListener instantiateMemberListener()
Instantiate a member listener to subscribe to service membership events.- Returns:
- a member listener
-
-