You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/02/28 00:44:06 UTC

[GitHub] [accumulo] drewfarris opened a new pull request #1537: Add PrintInfo options to dump full keys, apply formatter

drewfarris opened a new pull request #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] EdColeman commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
EdColeman 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_r385475020
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -119,6 +182,18 @@ public String keyword() {
     return "rfile-info";
   }
 
+  protected Class<? extends Formatter> getFormater(String formatterClazz) {
+    try {
+      if (formatterClazz != null) {
+        return this.getClass().getClassLoader().loadClass(formatterClazz)
+            .asSubclass(Formatter.class);
+      }
+    } catch (ClassNotFoundException e) {
+      System.err.println("Could not find formatter class: " + formatterClazz);
+    }
+    return null;
+  }
+
 
 Review comment:
   This is a general question - would this reflection code need to change for jdk-11+ (for when this is merged forward)? Specifically, is this still the standard way to use reflection, or has the "standard" changed?  From what I've read it looks okay, but thought it warranted checking.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] ctubbsii commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#issuecomment-596008328
 
 
   > Unfortunately there's just not a nice way to do that without opening multiple PR's which I'd like to avoid until we all have notional agreement that this is a good thing to do (in order to maintain a single conversation thread.)
   
   While I think new feature development in upstream Accumulo should focus on targeting the master branch, I understand the practical desire to have such features in currently used versions. Once we reach consensus on how this should look in master, I wouldn't be strongly opposed to backporting these flags to 1.10, if the change is small and can be done with minimal impact. I just think it's best to vet new features in master first, since that's where main development is happening.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#issuecomment-593468853
 
 
   > @drewfarris Do these changes work on the current development branch? (master) Specifically, I'm concerned that Formatter is not public API, and adding it here could cause problems between branches.
   > 
   
   Would Keith's suggestion of `BiFunction<Key, Value, String>` address this concern? It eliminates the reliance on the Formatter API entirely.
   
   > Also, new features typically shouldn't be added to maintenance branches. [..] . I could be convinced that these are important enough changes that we definitely need them in 1.10... but normally, I'd argue for changes like these to be put in the next version.
   
   I agree with the principle of adding this to the newest branch. We really shouldn't be adding features to a 'legacy' baseline. I don't have a compelling argument for putting in in `1.10` other than it is the version we're using in our development and production environments currently and I have a _practical need_ for this feature in that environment. I'd prefer not to maintain a patch/fork for this somewhat trivial feature that most folks won't observe.
   
   I agree with your point about the fact that this should be targeted at all branches 1.10, 2.0, 2.1 - and I intend to do that based on your feedback. Unfortunately there's just not a nice way to do that without opening multiple PR's which I'd like to avoid until we all have notional agreement that this is a good thing to do (in order to maintain a single conversation thread.)
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385921586
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -192,23 +268,43 @@ public void execute(final String[] args) throws Exception {
           }
         }
 
+        Formatter formatter = null;
+        if (opts.formatterClazz != null) {
+          final Class<? extends Formatter> formatterClass = getFormater(opts.formatterClazz);
+          FormatterConfig config = new FormatterConfig();
+          config.setPrintTimestamps(true);
+          formatter =
+              FormatterFactory.getFormatter(formatterClass, new FormatterAdapter(dataIter), config);
+        }
 
 Review comment:
   If using BiFunction could possibly do
   
   ```suggestion
           BiFunction<Key,Value,String> formatter = null;
           if (opts.formatterClazz != null) {
             final Class<? extends BiFunction<Key,Value,String>> formatterClass = getFormater(opts.formatterClazz);
             formatter = formatterClass.newInstance();
           } else if (opts.fullKeys) {
             formatter = (key, value) - > {key.toStringNoTruncate() + " -> " + value};
           } else if(opts.dump){
              formatter = (key, value) - > {key + " -> " + value};
           }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385918778
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -49,6 +59,12 @@
   static class Opts extends Help {
     @Parameter(names = {"-d", "--dump"}, description = "dump the key/value pairs")
     boolean dump = false;
+    @Parameter(names = {"--fullKeys"},
+        description = "dump full keys regardless of length, do no truncate, implies --dump")
+    boolean fullKeys = false;
+    @Parameter(names = {"--formatter"},
+        description = "specify a formatter class to apply to rfile contents, implies --dump")
 
 Review comment:
   The formatter class is a bit of a mess.  What do you think about accepting any class that implements `BiFunction<Key, Value, String>`?  If you have a strong need specifically for the formatter, please ignore the comments related to BiFunction

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris 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_r386467921
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -49,6 +59,12 @@
   static class Opts extends Help {
     @Parameter(names = {"-d", "--dump"}, description = "dump the key/value pairs")
     boolean dump = false;
+    @Parameter(names = {"--fullKeys"},
+        description = "dump full keys regardless of length, do no truncate, implies --dump")
+    boolean fullKeys = false;
+    @Parameter(names = {"--formatter"},
+        description = "specify a formatter class to apply to rfile contents, implies --dump")
 
 Review comment:
   Let me give this a shot. I can't recall whether Formatter implements `BiFunction<Key, Value String>` - I suspect it does not

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris 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_r386469392
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -192,23 +268,43 @@ public void execute(final String[] args) throws Exception {
           }
         }
 
+        Formatter formatter = null;
+        if (opts.formatterClazz != null) {
+          final Class<? extends Formatter> formatterClass = getFormater(opts.formatterClazz);
+          FormatterConfig config = new FormatterConfig();
+          config.setPrintTimestamps(true);
+          formatter =
+              FormatterFactory.getFormatter(formatterClass, new FormatterAdapter(dataIter), config);
+        }
+
         for (String lgName : localityGroupCF.keySet()) {
           LocalityGroupUtil.seek(dataIter, new Range(), lgName, localityGroupCF);
-          while (dataIter.hasTop()) {
-            Key key = dataIter.getTopKey();
-            Value value = dataIter.getTopValue();
-            if (opts.dump) {
-              System.out.println(key + " -> " + value);
-              if (System.out.checkError())
+
+          if (formatter != null) {
+            while (formatter.hasNext()) {
 
 Review comment:
   Yeah, I wasn't too happy about this one either. I suspect one approach would be to create a new instance of the formatter for each locality group.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385922287
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -192,23 +268,43 @@ public void execute(final String[] args) throws Exception {
           }
         }
 
+        Formatter formatter = null;
+        if (opts.formatterClazz != null) {
+          final Class<? extends Formatter> formatterClass = getFormater(opts.formatterClazz);
+          FormatterConfig config = new FormatterConfig();
+          config.setPrintTimestamps(true);
+          formatter =
+              FormatterFactory.getFormatter(formatterClass, new FormatterAdapter(dataIter), config);
+        }
+
         for (String lgName : localityGroupCF.keySet()) {
           LocalityGroupUtil.seek(dataIter, new Range(), lgName, localityGroupCF);
-          while (dataIter.hasTop()) {
-            Key key = dataIter.getTopKey();
-            Value value = dataIter.getTopValue();
-            if (opts.dump) {
-              System.out.println(key + " -> " + value);
-              if (System.out.checkError())
+
+          if (formatter != null) {
+            while (formatter.hasNext()) {
+              System.out.print(formatter.next());
+              if (System.out.checkError()) {
                 return;
+              }
             }
-            if (opts.histogram) {
-              kvHistogram.add(key.getSize() + value.getSize());
-            }
-            if (opts.keyStats) {
-              dataKeyStats.add(key);
+          } else {
+            while (dataIter.hasTop()) {
+              Key key = dataIter.getTopKey();
+              Value value = dataIter.getTopValue();
+              if (opts.dump || opts.fullKeys) {
+                System.out
+                    .println((opts.fullKeys ? key.toStringNoTruncate() : key) + " -> " + value);
 
 Review comment:
   ```suggestion
                 if (formatter != null) {
                   System.out
                       .println(formatter.apply(key,value));
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris edited a comment on issue #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris edited a comment on issue #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#issuecomment-593468853
 
 
   > @drewfarris Do these changes work on the current development branch? (master) Specifically, I'm concerned that Formatter is not public API, and adding it here could cause problems between branches.
   > 
   
   @ctubbsii Would Keith's suggestion of `BiFunction<Key, Value, String>` address this concern? It eliminates the reliance on the Formatter API entirely.
   
   > Also, new features typically shouldn't be added to maintenance branches. [..] . I could be convinced that these are important enough changes that we definitely need them in 1.10... but normally, I'd argue for changes like these to be put in the next version.
   
   I agree with the principle of adding this to the newest branch. We really shouldn't be adding features to a 'legacy' baseline. I don't have a compelling argument for putting in in `1.10` other than it is the version we're using in our development and production environments currently and I have a _practical need_ for this feature in that environment. I'd prefer not to maintain a patch/fork for this somewhat trivial feature that most folks won't observe.
   
   I agree with your point about the fact that this should be targeted at all branches 1.10, 2.0, 2.1 - and I intend to do that based on your feedback. Unfortunately there's just not a nice way to do that without opening multiple PR's which I'd like to avoid until we all have notional agreement that this is a good thing to do (in order to maintain a single conversation thread.)
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385921802
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -192,23 +268,43 @@ public void execute(final String[] args) throws Exception {
           }
         }
 
+        Formatter formatter = null;
+        if (opts.formatterClazz != null) {
+          final Class<? extends Formatter> formatterClass = getFormater(opts.formatterClazz);
+          FormatterConfig config = new FormatterConfig();
+          config.setPrintTimestamps(true);
+          formatter =
+              FormatterFactory.getFormatter(formatterClass, new FormatterAdapter(dataIter), config);
+        }
+
         for (String lgName : localityGroupCF.keySet()) {
           LocalityGroupUtil.seek(dataIter, new Range(), lgName, localityGroupCF);
-          while (dataIter.hasTop()) {
-            Key key = dataIter.getTopKey();
-            Value value = dataIter.getTopValue();
-            if (opts.dump) {
-              System.out.println(key + " -> " + value);
-              if (System.out.checkError())
+
+          if (formatter != null) {
+            while (formatter.hasNext()) {
+              System.out.print(formatter.next());
+              if (System.out.checkError()) {
                 return;
+              }
             }
 
 Review comment:
   If using BiFunction this could go away.
   
   ```suggestion
   
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris merged pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris merged pull request #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
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_r385477423
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -119,6 +182,18 @@ public String keyword() {
     return "rfile-info";
   }
 
+  protected Class<? extends Formatter> getFormater(String formatterClazz) {
+    try {
+      if (formatterClazz != null) {
+        return this.getClass().getClassLoader().loadClass(formatterClazz)
+            .asSubclass(Formatter.class);
+      }
+    } catch (ClassNotFoundException e) {
+      System.err.println("Could not find formatter class: " + formatterClazz);
+    }
+    return null;
+  }
+
 
 Review comment:
   I think this will work fine in Java 11, since it uses the class loader of the current class, and not the system class loader.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#issuecomment-595991057
 
 
   @ctubbsii - retargeted at _master_.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385922975
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -192,23 +268,43 @@ public void execute(final String[] args) throws Exception {
           }
         }
 
+        Formatter formatter = null;
+        if (opts.formatterClazz != null) {
+          final Class<? extends Formatter> formatterClass = getFormater(opts.formatterClazz);
+          FormatterConfig config = new FormatterConfig();
+          config.setPrintTimestamps(true);
+          formatter =
+              FormatterFactory.getFormatter(formatterClass, new FormatterAdapter(dataIter), config);
+        }
+
         for (String lgName : localityGroupCF.keySet()) {
           LocalityGroupUtil.seek(dataIter, new Range(), lgName, localityGroupCF);
-          while (dataIter.hasTop()) {
-            Key key = dataIter.getTopKey();
-            Value value = dataIter.getTopValue();
-            if (opts.dump) {
-              System.out.println(key + " -> " + value);
-              if (System.out.checkError())
+
+          if (formatter != null) {
+            while (formatter.hasNext()) {
 
 Review comment:
   This seems a bit dicey.  The underlying iterator is reset under the formatter for each locality group.  If formatter were stateful with hasNext() this may cause problems.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
drewfarris commented on issue #1537: Add PrintInfo options to dump full keys, apply formatter
URL: https://github.com/apache/accumulo/pull/1537#issuecomment-597074575
 
 
   > Would be nice to fail with an error message if --fullKeys and --formatter are specified.
   
   done. The wording is a little weird because both --fullKeys and --dump are mutually exclusive with --formater, but hopefully you'll agree this is sufficient as it.
   
   > If you assign the unchecked code to a variable, you can add this suppression on just that assignment, so it doesn't mask other (fixable, avoidable) problems in the method.
   
   done. I'd wanted to do this, but hadn't figured out the variable assignment bit, thanks.
   
   > 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.
   
   done, also removed the null check as it was unnecessary.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] keith-turner commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
keith-turner 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_r385922587
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
 ##########
 @@ -110,6 +126,53 @@ public void print(String indent) {
     }
   }
 
+  static class FormatterAdapter implements Iterable<Entry<Key,Value>> {
 
 Review comment:
   If using BiFunction, would not need this class.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1537: Add PrintInfo options to dump full keys, apply formatter

Posted by GitBox <gi...@apache.org>.
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_r389189014
 
 

 ##########
 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")
 
 Review comment:
   If you assign the unchecked code to a variable, you can add this suppression on just that assignment, so it doesn't mask other (fixable, avoidable) problems in the method.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services