Skip to content

Commit

Permalink
Changing roles counting behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandesh Kumar committed Feb 9, 2023
1 parent 415b06c commit 8234c2a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,13 @@ private Counts(final List<NodeInfo> nodeInfos) {
for (DiscoveryNodeRole role : nodeInfo.getNode().getRoles()) {
// TODO: Remove the 'if' condition and only keep the statement in 'else' after removing MASTER_ROLE.
// As of 2.0, CLUSTER_MANAGER_ROLE is added, and it should be taken as MASTER_ROLE
if (role.isClusterManager()) {
roles.merge(DiscoveryNodeRole.MASTER_ROLE.roleName(), 1, Integer::sum);
roles.merge(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), 1, Integer::sum);
} else {
roles.merge(role.roleName(), 1, Integer::sum);
}
// if (role.isClusterManager()) {
// roles.merge(DiscoveryNodeRole.MASTER_ROLE.roleName(), 1, Integer::sum);
// roles.merge(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), 1, Integer::sum);
// } else {
// roles.merge(role.roleName(), 1, Integer::sum);
// }
roles.merge(role.roleName(), 1, Integer::sum);
}
}
}
Expand Down

0 comments on commit 8234c2a

Please sign in to comment.