Skip to content

Commit

Permalink
[improve][broker]Reuse method getAvailableBrokersAsync (apache#23099)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2add3ab)
  • Loading branch information
crossoverJie authored and nikhil-ctds committed Aug 8, 2024
1 parent 70964e0 commit 1a87104
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ private void reapDeadBrokerPreallocations(List<String> aliveBrokers) {
@Override
public Set<String> getAvailableBrokers() {
try {
return new HashSet<>(brokersData.listLocks(LoadManager.LOADBALANCE_BROKERS_ROOT)
.get(conf.getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS));
return getAvailableBrokersAsync().get(conf.getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS);
} catch (Exception e) {
log.warn("Error when trying to get active brokers", e);
return loadData.getBrokerData().keySet();
Expand Down

0 comments on commit 1a87104

Please sign in to comment.