phrocker commented on a change in pull request #1527: Added detailed trace
logging for FATE #1316
URL: https://github.com/apache/accumulo/pull/1527#discussion_r384561638
##########
File path:
server/master/src/main/java/org/apache/accumulo/master/tableOps/TraceRepo.java
##########
@@ -72,4 +75,19 @@ public String getReturn() {
return repo.getReturn();
}
+ /**
+ * @return string version of Repo that is suitable for logging
+ */
+ public static String toLogString(Repo<Master> repo) {
+ if (repo instanceof TraceRepo) {
+ // There are two reasons the repo is unwrapped. First I could not figure
out how to get this
+ // to work with Gson. Gson kept serializing nothing for the generic
pointer TraceRepo.repo.
+ // Second I thought this information was not useful for logging.
+ repo = ((TraceRepo<Master>) repo).repo;
Review comment:
Memory may not be serving me well but I think you can define a
JSONSerializer that may help avoid this [1]. But I could be wrong as it's much
easier to be an armchair quarterback reviewer than the one writing the code :)
[1] https://howtodoinjava.com/gson/custom-serialization-deserialization/
----------------------------------------------------------------
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