virajjasani commented on a change in pull request #754: HBASE-22978 : Online
slow response log
URL: https://github.com/apache/hbase/pull/754#discussion_r378055692
##########
File path: hbase-shell/src/main/ruby/hbase/admin.rb
##########
@@ -1453,6 +1453,97 @@ def list_decommissioned_regionservers
@admin.listDecommissionedRegionServers
end
+
#----------------------------------------------------------------------------------------------
+ # Retrieve SlowLog Responses from RegionServers
+ def get_slowlog_responses(server_names, args)
+ unless server_names.is_a?(Array) || server_names.is_a?(String)
+ raise(ArgumentError,
+ "#{server_names.class} of #{server_names.inspect} is not of
Array/String type")
+ end
+ if server_names == '*'
+ server_names = getServerNames([], true)
+ else
+ server_names_list = get_server_names(server_names)
+ server_names = getServerNames(server_names_list, false)
+ end
+ slow_log_responses = @admin.getSlowLogResponses(server_names)
+ filtered_log_responses = filter_slow_responses(args,
+ slow_log_responses)
+ puts 'Retrieved SlowLog Responses from RegionServers.....'
+ if args.empty?
+ puts slow_log_responses.to_s
+ else
+ puts filtered_log_responses.to_s
+ end
+ end
+
+ def filter_slow_responses(args, slow_log_responses)
+ filtered_log_responses = java.util.ArrayList.new
Review comment:
Just re-iterating the comment on Jira to better align it here:
```
Copying Andrew's earlier comment:
"Filtering or sorting on other attributes would be done locally in the
client. I think it best to let the client index the list of ResponseDetail
however it likes.
The shell commands are one client of the admin APIs. This seems a good place
to put additional convenience filtering."
Although I agree with scalability concern but I believe filter done by
client(shell) might not be too much of an overhead right?
```
Even for quite hugh cluster, shell should be able to process it without
trouble.
Please suggest.
FYI @apurtell
----------------------------------------------------------------
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]
With regards,
Apache Git Services