kevinrr888 commented on code in PR #4912:
URL: https://github.com/apache/accumulo/pull/4912#discussion_r1778894394


##########
core/src/main/java/org/apache/accumulo/core/fate/FateKey.java:
##########
@@ -168,4 +168,12 @@ private static Optional<ExternalCompactionId> 
deserializeCompactionId(FateKeyTyp
         throw new IllegalStateException("Unexpected FateInstanceType found " + 
type);
     }
   }
+
+  @Override
+  public String toString() {
+    return "[" + getClass().getSimpleName() + " FateKeyType:" + type
+        + (keyExtent.isPresent() ? ", KeyExtent:" + keyExtent.orElseThrow()
+            : ", ExternalCompactionID:" + compactionId.orElseThrow())
+        + "]";
+  }

Review Comment:
   Thanks this is nicer
   3ca39d0d57fbf5321b3ca5abc8fee1b16a52c37f addresses this.
   Only thing different is 
   `compactionId.orElse(null)`
   instead I have
   `compactionId.orElseThrow()`
   since either one of KeyExtent or ExternalCompactionID should be present. 
This is handled in the FateKey object creation though and maybe shouldn't be 
added handling in a toString()... shouldn't make a difference either way though.



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