Package com.tangosol.net
Class ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.ConfigurableQuorumPolicy
com.tangosol.net.ConfigurableQuorumPolicy.MembershipQuorumPolicy
com.tangosol.net.ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy
- All Implemented Interfaces:
- ActionPolicy
- Enclosing class:
- ConfigurableQuorumPolicy
public static class ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy
extends ConfigurableQuorumPolicy.MembershipQuorumPolicy
PartitionedCacheQuorumPolicy defines a configurable quorum policy that is
 applicable to a DistributedCacheService.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumAction Rules forConfigurableQuorumPolicy.PartitionedCacheQuorumPolicystatic classNotification is a simple struct carrying the notification info.Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicy.MembershipQuorumPolicyConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumListener, ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRuleNested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicyConfigurableQuorumPolicy.ClusterQuorumPolicy, ConfigurableQuorumPolicy.MembershipQuorumPolicy, ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicyNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AddressProviderThe recovery address-provider.protected booleanIf set to true, indicates a dynamic active recovery strategy.protected longThe last time disallowed actions were reported.static final intBitmask used to encode a distribution action.protected static final intThe highest used bitmask value.static final intBitmask used to encode a read action.static final intBitmask used to encode a recover action.static final intBitmask used to encode a partition restore action.static final intBitmask used to encode a write action.Fields inherited from class com.tangosol.net.ConfigurableQuorumPolicy.MembershipQuorumPolicym_aRules, m_ruleCurrent, m_service, m_setLeaving
- 
Constructor SummaryConstructorsConstructorDescriptionPartitionedCacheQuorumPolicy(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule, AddressProvider provider) Construct a PartitionedCacheQuorumPolicy with the specified rule.
- 
Method SummaryModifier and TypeMethodDescriptionprotected static intcalculateMinimumNodeCount(Set<Member> setMembers) Given a set of Member objects, calculate the minimum number of nodes on a single machine.protected intcalculateMinThreshold(int cLast, float flPct) Calculate the minimum number of storage enabled nodes necessary to proceed with the service recovery.Check if the recovery is allowed for the current membership.protected StringgetActionName(int nMask) Return the string description of the given rule mask.protected SetReturn the set of ownership-enabled members in the associated PartitionedService.intCalculate and return the current size of the member set that contributes to the quorum for this policy domain.Return the associated PartitionedService.protected PartitionSetgetStalePartitions(PartitionedService.PartitionRecoveryAction action, PartitionSet partsRecover, PartitionSet partsMissing) Return staled partition set.Return a String that describes the current Quorum state.booleanEvaluate if the specified action is currently allowed by this policy.protected voidreportDisallowedAction(int nMaskDisallowed, List<ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy.Notification> listReasons) Report all disallowed actions if the quorum rule has changed.protected static StringreportLastOwnership(PartitionSet parts, com.tangosol.net.internal.QuorumInfo info) Report the machine names in the "last good" membership that owned the specified partitions.protected voidUpdate 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.MembershipQuorumPolicyconfigure, getCurrentRule, getLeavingMembers, getQuorumRules, getRule, init, instantiateMemberListener, setCurrentRule, setQuorumRules, setService, toStringMethods inherited from class com.tangosol.net.ConfigurableQuorumPolicyinstantiateClusterPolicy, instantiatePartitionedCachePolicy, instantiateProxyPolicyMethods 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
- 
Field Details- 
MASK_DISTRIBUTIONpublic static final int MASK_DISTRIBUTIONBitmask used to encode a distribution action.- See Also:
 
- 
MASK_RESTOREpublic static final int MASK_RESTOREBitmask used to encode a partition restore action.- See Also:
 
- 
MASK_READpublic static final int MASK_READBitmask used to encode a read action.- See Also:
 
- 
MASK_WRITEpublic static final int MASK_WRITEBitmask used to encode a write action.- See Also:
 
- 
MASK_RECOVERpublic static final int MASK_RECOVERBitmask used to encode a recover action.- See Also:
 
- 
MASK_LASTprotected static final int MASK_LASTThe highest used bitmask value.- See Also:
 
- 
m_apRecoveryThe recovery address-provider.
- 
m_ldtLastReportprotected long m_ldtLastReportThe last time disallowed actions were reported.
- 
m_fDynamicprotected boolean m_fDynamicIf set to true, indicates a dynamic active recovery strategy.
 
- 
- 
Constructor Details- 
PartitionedCacheQuorumPolicypublic PartitionedCacheQuorumPolicy(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule, AddressProvider provider) Construct a PartitionedCacheQuorumPolicy with the specified rule.- Parameters:
- aRule- the quorum rule
- provider- the recovery address-provider
 
 
- 
- 
Method Details- 
getOwnershipMemberSetReturn the set of ownership-enabled members in the associated PartitionedService.- Returns:
- the set of ownership-enabled members
 
- 
getServiceReturn the associated PartitionedService.- Overrides:
- getServicein class- ConfigurableQuorumPolicy.MembershipQuorumPolicy
- Returns:
- the associated PartitionedService
 
- 
checkRecoveryMembershipprotected List<ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy.Notification> checkRecoveryMembership(PartitionedService.PartitionRecoveryAction action) Check if the recovery is allowed for the current membership.
 If the address provider is specified, it means that all the recovery addresses are represented by the ownership-enabled members.
 For dynamic active persistence strategy it means that:- Global partition (partition 0) is recoverable.
- All machines, derived from the global partition, are present.
- All other partitions are accessible / recoverable across the service members.
- The number of members is larger than the threshold, which is calculated as a factor of the "last well-formed" member set size
 - Returns:
- null if the recovery is allowed; otherwise a list of rejection reasons
 
- 
getStalePartitionsprotected PartitionSet getStalePartitions(PartitionedService.PartitionRecoveryAction action, PartitionSet partsRecover, PartitionSet partsMissing) Return staled partition set.- Parameters:
- action- the recovery action
- partsRecover- the partitions to be recovered
- partsMissing- the partitions that are missing
- Returns:
- the staled partitions
 
- 
calculateMinThresholdprotected int calculateMinThreshold(int cLast, float flPct) Calculate the minimum number of storage enabled nodes necessary to proceed with the service recovery.- Parameters:
- cLast- the "last well-formed" member set size
- flPct- the percentage of "last well-formed" member set size
- Returns:
- the number of nodes necessary for the recovery to commence; the default implementation calculates it as "2/3" of the last "well-formed" member set size.
 
- 
reportLastOwnershipprotected static String reportLastOwnership(PartitionSet parts, com.tangosol.net.internal.QuorumInfo info) Report the machine names in the "last good" membership that owned the specified partitions.- Parameters:
- parts- the partitions to report
- info- the QuorumInfo containing the "last good" membership data
- Returns:
- the human readable string with the machine names
 
- 
calculateMinimumNodeCountGiven a set of Member objects, calculate the minimum number of nodes on a single machine.- Parameters:
- setMembers- the member set
- Returns:
- the minimum number of nodes for a machine
 
- 
getStatusDescriptionReturn a String that describes the current Quorum state.- Specified by:
- getStatusDescriptionin class- ConfigurableQuorumPolicy
- Returns:
- a String describing the allowed actions in the current state
 
- 
getPolicyPopulationpublic int getPolicyPopulation()Calculate and return the current size of the member set that contributes to the quorum for this policy domain.Note: The quorum for PartitionedService is determined by the ownership-enabled members only. - Overrides:
- getPolicyPopulationin class- ConfigurableQuorumPolicy.MembershipQuorumPolicy
- Returns:
- the current size
 
- 
isAllowedEvaluate 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. - 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
 
- 
updateCurrentRuleprotected void updateCurrentRule()Description copied from class:ConfigurableQuorumPolicy.MembershipQuorumPolicyUpdate the currently applicable quorum rule, possibly changing it to reflect growth or shrinkage of the membership size.- Overrides:
- updateCurrentRulein class- ConfigurableQuorumPolicy.MembershipQuorumPolicy
 
- 
reportDisallowedActionprotected void reportDisallowedAction(int nMaskDisallowed, List<ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy.Notification> listReasons) Report all disallowed actions if the quorum rule has changed.- Parameters:
- nMaskDisallowed- a mask of the disallowed action
- listReasons- (optional) a list of rejection reasons
 
- 
getActionNameReturn the string description of the given rule mask.- Parameters:
- nMask- the bitmask
- Returns:
- the string description of the given rule mask
 
 
-