eolivelli commented on code in PR #16281:
URL: https://github.com/apache/pulsar/pull/16281#discussion_r914732087
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerStrategy.java:
##########
@@ -49,12 +50,13 @@ Optional<String> selectBroker(Set<String> candidates,
BundleData bundleToAssign,
/**
* Create a placement strategy using the configuration.
*
+ * @param conf ServiceConfiguration to use.
* @return A placement strategy from the given configurations.
*/
- static ModularLoadManagerStrategy create() {
+ static ModularLoadManagerStrategy create(final ServiceConfiguration conf) {
try {
- // Only one strategy at the moment.
- return new LeastLongTermMessageRate();
+ return
Reflections.createInstance(conf.getLoadBalancerLoadPlacementStrategy(),
+ ModularLoadManagerStrategy.class,
Thread.currentThread().getContextClassLoader());
Review Comment:
Please do not ignore the error.
Otherwise the admin may have configured a wrong class name and the broker
will run in a way that is not expected.
We must fail the broker startup
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]