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.
  • Field Details

  • Constructor Details

    • MembershipQuorumPolicy

      protected MembershipQuorumPolicy()
      Create a MembershipQuorumPolicy.
  • Method Details

    • 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

      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

      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

      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

      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:
      toString in interface ActionPolicy
      Overrides:
      toString in class Object
    • instantiateMemberListener

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