keith-turner commented on a change in pull request #1527: Added detailed trace 
logging for FATE #1316
URL: https://github.com/apache/accumulo/pull/1527#discussion_r384647250
 
 

 ##########
 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:
   I think I tried some of those.  My solutions kept leading to an infinite 
loop or no output.  The wall I kept running into was that Gson wanted to work 
with concrete types. I had a generic interface that I wanted Gson to generate 
json for.  Gson did not like that, it wants to write out things that could be 
deserialized.  I was trying to get it write json out that it would not be able 
to deserialize back into concrete types.

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

Reply via email to