Class WeightedRoundRobin

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class WeightedRoundRobin
    extends java.lang.Object
    implements java.io.Externalizable
    This class encapsulates the configuration data for a weighted round robin policy. This load balancing policy distributes messages based on the weights assigned to each of the brokers in the cluster. The weight signifies the processing capabilities of a broker in the cluster and should be set appropriately by the user for the broker to handle more or fewer messages.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBrokerName()
      Get the name of cluster broker for which the weight is configured.
      java.lang.Integer getWeight()
      Get the weight associated with a cluster broker governed by a Weighted Round Robin policy
      void readExternal​(java.io.ObjectInput in)  
      void setBrokerName​(java.lang.String brokerName)
      Set the name of cluster broker for which the weight is configured.
      void setWeight​(java.lang.Integer weight)
      Set the weight for a cluster broker which is governed by a Weighted Round Robin policy
      java.lang.String toString()
      Returns the string representation of the Broker and the corresponding weight.
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

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

      • WeightedRoundRobin

        public WeightedRoundRobin()
    • Method Detail

      • getBrokerName

        public java.lang.String getBrokerName()
        Get the name of cluster broker for which the weight is configured.
        Returns:
        broker name
      • setBrokerName

        public void setBrokerName​(java.lang.String brokerName)
        Set the name of cluster broker for which the weight is configured.
        Parameters:
        brokerName -
      • getWeight

        public java.lang.Integer getWeight()
        Get the weight associated with a cluster broker governed by a Weighted Round Robin policy
        Returns:
        weight
      • setWeight

        public void setWeight​(java.lang.Integer weight)
        Set the weight for a cluster broker which is governed by a Weighted Round Robin policy
        Parameters:
        weight -
      • toString

        public java.lang.String toString()
        Returns the string representation of the Broker and the corresponding weight.
        Overrides:
        toString in class java.lang.Object
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException