Class BrokerVersionFilter
- java.lang.Object
-
- org.apache.pulsar.broker.loadbalance.impl.BrokerVersionFilter
-
- All Implemented Interfaces:
BrokerFilter
public class BrokerVersionFilter extends java.lang.Object implements BrokerFilter
-
-
Constructor Summary
Constructors Constructor Description BrokerVersionFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(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.VersiongetLatestVersionNumber(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.
-
-
-
Method Detail
-
getLatestVersionNumber
public com.github.zafarkhaja.semver.Version getLatestVersionNumber(java.util.Set<java.lang.String> brokers, LoadData loadData) throws BrokerFilterBadVersionExceptionGet 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 BrokerFilterBadVersionExceptionFrom the given set of available broker candidates, filter those using the version numbers.- Specified by:
filterin interfaceBrokerFilter- 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
-
-