ctubbsii commented on a change in pull request #1537: Add PrintInfo options to 
dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#discussion_r389189278
 
 

 ##########
 File path: 
core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -138,6 +146,19 @@ public String description() {
     return "Prints rfile info";
   }
 
+  @SuppressWarnings("unchecked")
+  protected Class<? extends BiFunction<Key,Value,String>> getFormatter(String 
formatterClazz) {
+    try {
+      if (formatterClazz != null) {
+        return (Class<? extends BiFunction<Key,Value,String>>) 
this.getClass().getClassLoader()
+            .loadClass(formatterClazz).asSubclass(BiFunction.class);
+      }
+    } catch (ClassNotFoundException e) {
+      System.err.println("Could not find formatter class: " + formatterClazz);
 
 Review comment:
   If the user's command-line cannot be satisfied (probably a typo in their 
class name), we should probably hard-fail by letting this exception fall 
through, rather than returning null and by effetively wasting time dumping a 
file in a format the user doesn't want.

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