Package com.tangosol.net
Class ConfigurableQuorumPolicy.ClusterQuorumPolicy
- java.lang.Object
- 
- com.tangosol.util.Base
- 
- com.tangosol.net.ConfigurableQuorumPolicy
- 
- com.tangosol.net.ConfigurableQuorumPolicy.ClusterQuorumPolicy
 
 
 
- 
- All Implemented Interfaces:
- ActionPolicy
 - Enclosing class:
- ConfigurableQuorumPolicy
 
 public static class ConfigurableQuorumPolicy.ClusterQuorumPolicy extends ConfigurableQuorumPolicy implements ActionPolicy ClusterQuorumPolicy defines an action policy that is applicable to the cluster.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicyConfigurableQuorumPolicy.ClusterQuorumPolicy, ConfigurableQuorumPolicy.MembershipQuorumPolicy, ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicy
 - 
Nested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Map<String,Integer>m_mapQuorumByRoleThe cluster membership quorum map, keyed by role name.protected Servicem_serviceThe cluster service.static StringMACHINESThe role prefix to use for the "timeout-machine-quorum".static StringROLE_ALLThe role identifier to use for matching any cluster members.static StringSITESThe role prefix to use for the "timeout-site-quorum".
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedClusterQuorumPolicy(Map<String,Integer> mapQuorum)Construct a ClusterQuorumPolicy with the specified quorum map.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckMachineQuorum(int cQuorum, Set<Member> setMembers, Set<Member> setTimedOut, Set<Member> setHealthy, Set<Member> setAnnouncing)Check whether the machine quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.protected booleancheckRoleQuorum(int cQuorum, Set setMembers, Set setTimedOut, Set setHealthy, Set setAnnouncing)Check whether the member quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.protected booleancheckSiteQuorum(int cQuorum, Set<Member> setMembers, Set<Member> setTimedOut, Set<Member> setHealthy, Set<Member> setAnnouncing)Check whether the site quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.protected SetensureSet(Set set)Return the specified set, or an empty set if null.protected Map<String,Integer>getClusterQuorumMap()Return the cluster quorum map, keyed by role name.ServicegetService()Return the Cluster service.StringgetStatusDescription()Return a String that describes the current Quorum state.protected Map<String,Set<Member>>groupMembersByRole(Set<Member> setMembers)Group the specified set of Members by their roles.voidinit(Service service)Called when the specified service loads and configures this policy.booleanisAllowed(Service service, Action action)Evaluate if the specified action is currently allowed by this policy.protected voidsetClusterQuorumMap(Map mapQuorumByRole)Set the cluster quorum map, keyed by role name.voidsetService(Service service)Set the Cluster service.- 
Methods inherited from class com.tangosol.net.ConfigurableQuorumPolicyinstantiateClusterPolicy, instantiatePartitionedCachePolicy, instantiateProxyPolicy
 - 
Methods inherited from class com.tangosol.util.Baseazzert, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.tangosol.net.ActionPolicytoString
 
- 
 
- 
- 
- 
Field Detail- 
ROLE_ALLpublic static final String ROLE_ALL The role identifier to use for matching any cluster members.- See Also:
- Constant Field Values
 
 - 
SITESpublic static final String SITES The role prefix to use for the "timeout-site-quorum".- See Also:
- Constant Field Values
 
 - 
MACHINESpublic static final String MACHINES The role prefix to use for the "timeout-machine-quorum".- See Also:
- Constant Field Values
 
 - 
m_serviceprotected Service m_service The cluster service.
 
- 
 - 
Method Detail- 
getClusterQuorumMapprotected Map<String,Integer> getClusterQuorumMap() Return the cluster quorum map, keyed by role name.- Returns:
- the cluster quorum map
 
 - 
setClusterQuorumMapprotected void setClusterQuorumMap(Map mapQuorumByRole) Set the cluster quorum map, keyed by role name.- Parameters:
- mapQuorumByRole- the cluster quorum map
 
 - 
getServicepublic Service getService() Return the Cluster service.- Returns:
- the Cluster service
 
 - 
setServicepublic void setService(Service service) Set the Cluster service.- Parameters:
- service- the Cluster service
 
 - 
getStatusDescriptionpublic String getStatusDescription() Return a String that describes the current Quorum state.- Specified by:
- getStatusDescriptionin class- ConfigurableQuorumPolicy
- Returns:
- a String describing the allowed actions in the current state
 
 - 
ensureSetprotected Set ensureSet(Set set) Return the specified set, or an empty set if null.- Parameters:
- set- the set to ensure, or null
- Returns:
- the specified set, or an empty set if null
 
 - 
groupMembersByRoleprotected Map<String,Set<Member>> groupMembersByRole(Set<Member> setMembers) Group the specified set of Members by their roles.- Parameters:
- setMembers- the set of Members
- Returns:
- a map, keyed by role name, of the subsets of Members in that role
 
 - 
checkSiteQuorumprotected boolean checkSiteQuorum(int cQuorum, Set<Member> setMembers, Set<Member> setTimedOut, Set<Member> setHealthy, Set<Member> setAnnouncing)Check whether the site quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.- Parameters:
- setMembers- the set of cluster members in the specified role
- setTimedOut- the subset of cluster members in the specified role that are timed-out. A member is considered timed-out if it has not responded to some network communications within the configured timeout, and it has been selected for termination
- setHealthy- the subset of cluster members in the specified role that are known to be "healthy". A member is "healthy" if it has been "recently" heard from
- setAnnouncing- the set of potential new cluster members in the specified role that are announcing their presence and waiting to join the cluster
- Returns:
- true iff the site quorum for the specified role would be preserved if the specified timed-out members were disconnected
 
 - 
checkMachineQuorumprotected boolean checkMachineQuorum(int cQuorum, Set<Member> setMembers, Set<Member> setTimedOut, Set<Member> setHealthy, Set<Member> setAnnouncing)Check whether the machine quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.- Parameters:
- setMembers- the set of cluster members in the specified role
- setTimedOut- the subset of cluster members in the specified role that are timed-out. A member is considered timed-out if it has not responded to some network communications within the configured timeout, and it has been selected for termination
- setHealthy- the subset of cluster members in the specified role that are known to be "healthy". A member is "healthy" if it has been "recently" heard from
- setAnnouncing- the set of potential new cluster members in the specified role that are announcing their presence and waiting to join the cluster
- Returns:
- true iff the site quorum for the specified role would be preserved if the specified timed-out members were disconnected
 
 - 
checkRoleQuorumprotected boolean checkRoleQuorum(int cQuorum, Set setMembers, Set setTimedOut, Set setHealthy, Set setAnnouncing)Check whether the member quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.- Parameters:
- setMembers- the set of cluster members in the specified role
- setTimedOut- the subset of cluster members in the specified role that are timed-out. A member is considered timed-out if it has not responded to some network communications within the configured timeout, and it has been selected for termination
- setHealthy- the subset of cluster members in the specified role that are known to be "healthy". A member is "healthy" if it has been "recently" heard from
- setAnnouncing- the set of potential new cluster members in the specified role that are announcing their presence and waiting to join the cluster
- Returns:
- true iff the member quorum for the specified role would be preserved if the specified timed-out members were disconnected
 
 - 
initpublic void init(Service service) Called when the specified service loads and configures this policy.Note: A policy could be applied to multiple services. - Specified by:
- initin interface- ActionPolicy
- Parameters:
- service- the service that this policy applies to
 
 - 
isAllowedpublic boolean isAllowed(Service service, Action action) Evaluate if the specified action is currently allowed by this policy.Note: for forward compatibility, implementations should generally return true for actions that are not recognized. - Specified by:
- isAllowedin interface- ActionPolicy
- Parameters:
- service- the service that is performing the action
- action- the action that is being performed
- Returns:
- true iff the specified action is currently allowed by this policy
 
 
- 
 
-