Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.net
Class ConfigurableQuorumPolicy.MembershipQuorumPolicy

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.ConfigurableQuorumPolicy
          extended by 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
protected  class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumListener
          QuorumListener is used to subscribe the quorum policy to receive service membership events.
static class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule
          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, ConfigurableQuorumPolicy.WrapperQuorumPolicy

 

Field Summary
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] m_aRules
          The list of quorum rules.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule m_ruleCurrent
          The current state.
protected  Service m_service
          The Service that this policy applies to.
protected  java.util.Set m_setLeaving
          The set of leaving members.

 

Constructor Summary
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy()
          Create a MembershipQuorumPolicy.

 

Method Summary
protected  void configure(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Configure and initialize this policy with the specified quorum rules.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule getCurrentRule()
          Return the current quorum rule used by the policy.
protected  java.util.Set getLeavingMembers()
          Return the set of members that are leaving the associated service
protected  int getPolicyPopulation()
          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.
 Service getService()
          Return the Service which this policy applies to.
 void init(Service service)
          Called when the specified service loads and configures this policy.
protected  MemberListener instantiateMemberListener()
          Instantiate a member listener to subscribe to service membership events.
protected  void setCurrentRule(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ruleCurrent)
          Set the current quorum rule used by the policy.
protected  void setQuorumRules(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Set the quorum rules used by this policy.
protected  void setService(Service service)
          Set the service that this policy applies to.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] sortByThreshold(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Sort the specified list of rules in ascending order of member threshold.
 java.lang.String toString()
          Return a human-readable String representation of this ActionPolicy.
protected  void updateCurrentRule()
          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 interface com.tangosol.net.ActionPolicy
isAllowed

 

Field Detail

m_setLeaving

protected java.util.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 list of quorum rules.

Constructor Detail

ConfigurableQuorumPolicy.MembershipQuorumPolicy

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy()
Create a MembershipQuorumPolicy.

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

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 java.util.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

sortByThreshold

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] sortByThreshold(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
Sort the specified list of rules in ascending order of member threshold.
Parameters:
aRule - the list of rules to sort
Returns:
the sorted list of rules

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 java.lang.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.


instantiateMemberListener

protected MemberListener instantiateMemberListener()
Instantiate a member listener to subscribe to service membership events.
Returns:
a member listener

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.