accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (ACCUMULO-3585) toString on Array doesn't log information as expected
Date Thu, 12 Feb 2015 22:55:12 GMT

     [ https://issues.apache.org/jira/browse/ACCUMULO-3585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Josh Elser resolved ACCUMULO-3585.
----------------------------------
    Resolution: Fixed

Added a bunch of comments to the class to help understand exactly what it was doing.

fileSizes doesn't need to be repeatedly logged as it's not modified within the loop. The log
statement was changed to log the filename and the table reference bitset.

> toString on Array doesn't log information as expected
> -----------------------------------------------------
>
>                 Key: ACCUMULO-3585
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3585
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.6.2
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Trivial
>             Fix For: 1.7.0, 1.6.3
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {noformat}
> > http://git-wip-us.apache.org/repos/asf/accumulo/blob/ac44627e/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
> > ----------------------------------------------------------------------
> > diff --git
> > a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
> > b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
> > index 9a54927..24eac05 100644
> > ---
> > a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
> > +++
> > b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
> > @@ -96,7 +96,9 @@ public class TableDiskUsage {
> >      Map<List<Integer>,Long> usage = new HashMap<List<Integer>,Long>();
> >
> >      for (Entry<String,Integer[]> entry : tableFiles.entrySet()) {
> > -      log.info("fileSizes " + fileSizes + " key " +
> > Arrays.asList(entry.getKey()));
> > +      if (log.isTraceEnabled()) {
> > +        log.trace("fileSizes " + fileSizes + " key " + entry.getKey());
> > +      }
> >
> {noformat}
> Caught by [~kturner]
> {quote}
> Arrays usually have completely useless toString() methods.  So going from
> Arrays.asList(entry.getKey()).toString() to entry.getKey().toString().
> will likely not print the Integer[] array contents
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message