bbeaudreault commented on code in PR #5155:
URL: https://github.com/apache/hbase/pull/5155#discussion_r1161121491


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/OnlineLogRecord.java:
##########
@@ -52,6 +59,15 @@ final public class OnlineLogRecord extends LogEntry {
         if (slowLogPayload.getMultiServiceCalls() == 0) {
           jsonObj.remove("multiServiceCalls");
         }
+        if (slowLogPayload.getScan().isPresent()) {
+          try {
+            jsonObj.add("scan", 
JsonParser.parseString(slowLogPayload.getScan().get().toJSON()));

Review Comment:
   Can't you do this?
   
   ```
   jsonObj.add("scan", gson.toJsonTree(scan.toMap()));
   ```
   
   I think this is categorically better than 
`JsonParser.parseString(slowLogPayload.getScan().get().toJSON())`. The reason 
is because the current approach requires going `scan -> map -> JsonElement -> 
string -> JsonElement -> String` (the latter two coming from JsonParser and 
then the serialization of the resulting `jsonObj`. The approach recommended 
above just has to go `scan -> map -> JsonElement -> string`.



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