rmdmattingly commented on code in PR #5335:
URL: https://github.com/apache/hbase/pull/5335#discussion_r1278584589
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/OnlineLogRecord.java:
##########
@@ -53,6 +56,18 @@ final public class OnlineLogRecord extends LogEntry {
if (slowLogPayload.getMultiServiceCalls() == 0) {
jsonObj.remove("multiServiceCalls");
}
+ if (slowLogPayload.getRequestAttributes().isEmpty()) {
+ jsonObj.remove("requestAttributes");
+ } else {
+ jsonObj.add("requestAttributes",
+
gson.toJsonTree(deserializeAttributes(slowLogPayload.getRequestAttributes())));
+ }
+ if (slowLogPayload.getConnectionAttributes().isEmpty()) {
+ jsonObj.remove("connectionAttributes");
+ } else {
+ jsonObj.add("connectionAttributes",
+
gson.toJsonTree(deserializeAttributes(slowLogPayload.getConnectionAttributes())));
+ }
Review Comment:
If present, this will spit out a blob like:
```json
{
"startTime": 1,
"processingTime": 2,
"queueTime": 3,
"responseSize": 4,
"blockBytesScanned": 5,
"multiGetsCount": 6,
"multiMutationsCount": 7,
"requestAttributes": {
"r": "1"
},
"connectionAttributes": {
"c": "1"
}
}
```
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/OnlineLogRecord.java:
##########
@@ -330,7 +373,14 @@ public String toString() {
.append("methodName", methodName).append("callDetails",
callDetails).append("param", param)
.append("regionName", regionName).append("userName", userName)
.append("multiGetsCount", multiGetsCount).append("multiMutationsCount",
multiMutationsCount)
- .append("multiServiceCalls", multiServiceCalls).append("scan",
scan).toString();
+ .append("multiServiceCalls", multiServiceCalls).append("scan", scan)
+ .append("requestAttributes", requestAttributes)
+ .append("connectionAttributes", connectionAttributes).toString();
+ }
+
+ public static Map<String, String> deserializeAttributes(Map<String, byte[]>
attributes) {
+ return attributes.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, entry ->
Bytes.toString(entry.getValue())));
}
Review Comment:
I made this public because we'll want to reuse this logic when deserializing
attributes for the RS UI's Operation Details page
##########
hbase-server/src/main/resources/hbase-webapps/regionserver/rsOperationDetails.jsp:
##########
@@ -25,6 +25,7 @@
import="org.apache.hadoop.util.StringUtils"
import="org.apache.hadoop.hbase.regionserver.HRegionServer"
import="org.apache.hadoop.hbase.HConstants"
+ import="org.apache.hadoop.hbase.client.OnlineLogRecord.deserializeAttributes"
Review Comment:
I haven't tested the changes in this class yet. My plan at the moment is to
load this branch onto a test cluster and manually validate that the RS UI is
working as intended. Please let me know if there's a better testing approach
for these jsp changes
--
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]