Class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule

    • Constructor Detail

      • QuorumRule

        public QuorumRule​(int nRuleMask,
                          int nThreshold)
        Construct a state with the specified threshold and numeric representation.
        Parameters:
        nRuleMask - numeric representation of the state
        nThreshold - the size threshold of the state
      • QuorumRule

        public QuorumRule​(int nRuleMask,
                          int nThreshold,
                          float flThresholdPct)
        Construct a state with the specified threshold and numeric representation.
        Parameters:
        nRuleMask - numeric representation of the state
        nThreshold - the size threshold of the state
        flThresholdPct - the size of threshold of the state in percentage
    • Method Detail

      • contains

        protected boolean contains​(int nMask)
        Return true if the current rule contains the specified action mask.
        Parameters:
        nMask - the action bitmask to test for
        Returns:
        true if the current rule contains the specified action mask
      • getRuleMask

        protected int getRuleMask()
        Return the numeric representation of the actions allowed by this rule.
        Returns:
        the numeric representation of this rule
      • setRuleMask

        protected void setRuleMask​(int nRuleMask)
        Set the numeric representation of the actions allowed by this rule.
        Parameters:
        nRuleMask - the numeric representation of this rule
      • getThreshold

        protected int getThreshold()
        Return the size threshold for this rule.
        Returns:
        the size threshold for this rule
      • setThreshold

        protected void setThreshold​(int nThreshold)
        Set the size threshold for this rule.
        Parameters:
        nThreshold - the size threshold for this rule
      • getThresholdFactor

        protected float getThresholdFactor()
        Return the percentage threshold for this rule.
        Returns:
        the percentage threshold for this rule
      • setThresholdFactor

        protected void setThresholdFactor​(float flThreshold)
        Set the percentage threshold for this rule.
        Parameters:
        flThreshold - the percentage threshold for this rule