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:
[email protected]
With regards,
Apache Git Services