hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Runping Qi (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HADOOP-2811) method Counters.makeCompactString() does not insert separator char ',' between the counters of different groups.
Date Thu, 14 Feb 2008 00:29:08 GMT

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

Runping Qi updated HADOOP-2811:
-------------------------------

    Status: Patch Available  (was: Open)


Patch is attached.


> method Counters.makeCompactString() does not insert separator char ',' between the counters
of different groups.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-2811
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2811
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: mapred
>    Affects Versions: 0.16.0
>            Reporter: Runping Qi
>            Priority: Critical
>             Fix For: 0.16.1
>
>         Attachments: patch-2811.txt
>
>
> The corrent code is:
> {code}
>  public synchronized String makeCompactString() {
>     StringBuffer buffer = new StringBuffer();
>       for(Group group: this){
>       boolean first = true;
>       for(Counter counter: group) {
>         if (first) {
>           first = false;
>         } else {
>           buffer.append(',');
>         }
>         buffer.append(group.getDisplayName());
>         buffer.append('.');
>         buffer.append(counter.getDisplayName());
>         buffer.append('=');
>         buffer.append(counter.getCounter());
>       }
>     }
>     return buffer.toString();
>   }
> {code}
> The correct code should be like:
> {code}
>  public synchronized String makeCompactString() {
>     StringBuffer buffer = new StringBuffer();
>     boolean first = true;
>     for(Group group: this){
>       
>       for(Counter counter: group) {
>         if (first) {
>           first = false;
>         } else {
>           buffer.append(',');
>         }
>         buffer.append(group.getDisplayName());
>         buffer.append('.');
>         buffer.append(counter.getDisplayName());
>         buffer.append('=');
>         buffer.append(counter.getCounter());
>       }
>     }
>     return buffer.toString();
>   }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message