[ 
https://issues.apache.org/jira/browse/HADOOP-4226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635493#action_12635493
 ] 

Chris Douglas commented on HADOOP-4226:
---------------------------------------

bq. I'm not a java programmer, so I could use some advice here on where would 
such summary go
Though we have some 
[standards|http://java.sun.com/docs/codeconv/html/CodeConventions.doc4.html#16838],
 these in particular aren't strictly followed. The vast, vast majority of users 
shouldn't see this, so putting it in the javadoc is probably unnecessary. A 
sketch of the algorithm could follow the declaration/signature of the method in 
a few lines of block comments. After that, the only pieces that require 
comments are those that aren't obvious, e.g. why bytesConsumed can't terminate 
the loop if we only have \r.

bq. If people were to re-use this class with different newline separators, they 
might find it useful to be able to change CR and LF
It's pretty specialized code... I'd much rather lock it down until we have a 
use case. Having non-final, public static fields is generally considered bad 
practice. It makes the code unverifiable in isolation and admits some very 
difficult bugs (and races if two classes assign different values to CR and LF).

> LineReader::readLine cleanup
> ----------------------------
>
>                 Key: HADOOP-4226
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4226
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: mapred
>    Affects Versions: 0.19.0
>            Reporter: Yuri Pradkin
>            Assignee: Yuri Pradkin
>            Priority: Minor
>         Attachments: HADOOP-4226.patch
>
>
> I've been looking at HADOOP-4010 and realized that readLine is pretty 
> convoluted.  I changed the implementation which made it hopefully a little 
> easier to read/validate/understand.  
> I've had some problems testing it locally, so I'll submit it for Hudson to 
> test.

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

Reply via email to