Class QuorumMaj

  • All Implemented Interfaces:
    QuorumVerifier

    public class QuorumMaj
    extends java.lang.Object
    implements QuorumVerifier
    This class implements a validator for majority quorums. The implementation is straightforward.
    • Constructor Summary

      Constructors 
      Constructor Description
      QuorumMaj​(int n)
      Defines a majority to avoid computing it every time.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsQuorum​(java.util.Set<java.lang.Long> set)
      Verifies if a set is a majority.
      long getWeight​(long id)
      Returns weight of 1 by default.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QuorumMaj

        public QuorumMaj​(int n)
        Defines a majority to avoid computing it every time.
        Parameters:
        n - number of servers
    • Method Detail

      • getWeight

        public long getWeight​(long id)
        Returns weight of 1 by default.
        Specified by:
        getWeight in interface QuorumVerifier
        Parameters:
        id -
      • containsQuorum

        public boolean containsQuorum​(java.util.Set<java.lang.Long> set)
        Verifies if a set is a majority.
        Specified by:
        containsQuorum in interface QuorumVerifier