Skip to content

Commit

Permalink
[ISSUE #8454] Active brokers number should be initailized to 1 in bro…
Browse files Browse the repository at this point in the history
…ker heartbeat manager. (#8453)

* active brokers should be 1 on computing if absent

* active brokers number should be initailized to 1 in broker heartbeat manager.
  • Loading branch information
ShannonDing authored Jul 28, 2024
1 parent 3722431 commit cc484d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Map<String, Map<String, Integer>> getActiveBrokersNum() {
.forEach(id -> {
map.computeIfAbsent(id.getClusterName(), k -> new HashMap<>());
map.get(id.getClusterName()).compute(id.getBrokerName(), (broker, num) ->
num == null ? 0 : num + 1
num == null ? 1 : num + 1
);
});
return map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public Map<String, Map<String, Integer>> getActiveBrokersNum() {
.forEach(id -> {
map.computeIfAbsent(id.getClusterName(), k -> new HashMap<>());
map.get(id.getClusterName()).compute(id.getBrokerName(), (broker, num) ->
num == null ? 0 : num + 1
num == null ? 1 : num + 1
);
});
return map;
Expand Down

0 comments on commit cc484d5

Please sign in to comment.