merlimat commented on a change in pull request #10391:
URL: https://github.com/apache/pulsar/pull/10391#discussion_r623312045
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
##########
@@ -341,88 +281,69 @@ public void start() throws PulsarServerException {
LOADBALANCER_DYNAMIC_SETTING_LOAD_FACTOR_MEM_ZPATH,
SETTING_NAME_LOAD_FACTOR_MEM,
this.realtimeMemoryLoadFactor);
} catch (Exception e) {
- log.error("Unable to create znode - [{}] for load balance on
zookeeper ", brokerZnodePath, e);
+ log.error("Unable to create node - [{}] for load balance on
metadata store", brokerLockPath, e);
throw new PulsarServerException(e);
}
}
@Override
public void disableBroker() throws Exception {
- if (isNotEmpty(brokerZnodePath)) {
- pulsar.getZkClient().delete(brokerZnodePath, -1);
+ if (brokerLock != null) {
+ brokerLock.release().join();
}
}
- @Override
- public Deserializer<LoadReport> getLoadReportDeserializer() {
- return loadReportDeserializer;
- }
-
- public ZooKeeperChildrenCache getActiveBrokersCache() {
- return this.availableActiveBrokers;
- }
-
@Override
public Set<String> getAvailableBrokers() throws Exception {
- return this.availableActiveBrokers.get();
- }
-
- public ZooKeeperDataCache<LoadReport> getLoadReportCache() {
- return this.loadReportCacheZk;
+ return new
HashSet<>(loadReports.listLocks(LOADBALANCE_BROKERS_ROOT).join());
Review comment:
Simplified these
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]