Class BrokerVersionFilter

  • All Implemented Interfaces:
    BrokerFilter

    public class BrokerVersionFilter
    extends java.lang.Object
    implements BrokerFilter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void filter​(java.util.Set<java.lang.String> brokers, BundleData bundleToAssign, LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf)
      From the given set of available broker candidates, filter those using the version numbers.
      com.github.zafarkhaja.semver.Version getLatestVersionNumber​(java.util.Set<java.lang.String> brokers, LoadData loadData)
      Get the most recent broker version number from the load reports of all the running brokers.
      • Methods inherited from class java.lang.Object

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

      • BrokerVersionFilter

        public BrokerVersionFilter()
    • Method Detail

      • getLatestVersionNumber

        public com.github.zafarkhaja.semver.Version getLatestVersionNumber​(java.util.Set<java.lang.String> brokers,
                                                                           LoadData loadData)
                                                                    throws BrokerFilterBadVersionException
        Get the most recent broker version number from the load reports of all the running brokers. The version number is from the build artifact in the pom and got added to the package when it was built by Maven
        Parameters:
        brokers - The brokers to choose the latest version string from.
        loadData - The load data from the leader broker (contains the load reports which in turn contain the version string).
        Returns:
        The most recent broker version
        Throws:
        BrokerFilterBadVersionException - If the most recent version is undefined (e.g., a bad broker version was encountered or a broker does not have a version string in its load report.
      • filter

        public void filter​(java.util.Set<java.lang.String> brokers,
                           BundleData bundleToAssign,
                           LoadData loadData,
                           org.apache.pulsar.broker.ServiceConfiguration conf)
                    throws BrokerFilterBadVersionException
        From the given set of available broker candidates, filter those using the version numbers.
        Specified by:
        filter in interface BrokerFilter
        Parameters:
        brokers - The currently available brokers that have not already been filtered.
        bundleToAssign - The data for the bundle to assign.
        loadData - The load data from the leader broker.
        conf - The service configuration.
        Throws:
        BrokerFilterBadVersionException