Copilot commented on code in PR #7193:
URL: https://github.com/apache/hbase/pull/7193#discussion_r2257201646


##########
hbase-shell/src/main/ruby/hbase/admin.rb:
##########
@@ -1029,11 +1029,11 @@ def status(format, type)
             puts('    no active tasks')
           end
         end
-        puts(format('%d live servers', cluster_metrics.getServersSize))
-        for server in cluster_metrics.getServers
-          puts(format('    %s:%d %d', server.getHostname, server.getPort, 
server.getStartcode))
+        puts(format('%d live servers', 
cluster_metrics.getLiveServerMetrics.size))
+        cluster_metrics.getLiveServerMetrics.keySet.each do |server_name|
+          puts(format('    %s:%d %d', server_name.getHostname, 
server_name.getPort, server_name.getStartcode))
           printed = false
-          for task in cluster_metrics.getLiveServerMetrics.get(server).getTasks
+          for task in 
cluster_metrics.getLiveServerMetrics.get(server_name).getTasks

Review Comment:
   Consider adding null safety check for 
`cluster_metrics.getLiveServerMetrics.get(server_name)` as the get operation 
could potentially return null if the server is no longer available.



-- 
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]

Reply via email to