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

Mingliang Liu commented on HADOOP-12831:
----------------------------------------

It looks like in {{DataChecksum#newDataChecksum}}, returning null is by desgin:
{code}
  public static DataChecksum newDataChecksum(Type type, int bytesPerChecksum ) {
    if ( bytesPerChecksum <= 0 ) {
      return null;
    }
...
{code}
The reason may be that, the bytesPerChecksum was used as divisor for 
calculating number of chunks and checksum buffer size. We can document this, or 
throw exception with a user-friendly message for this.

I think this is not feasible to disable checksumming and buffering in this way. 
Will {{RawLocalFileSystem}} work in your case?

> LocalFS/FSOutputSummer NPEs in constructor if bytes per checksum  set to 0
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-12831
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12831
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.8.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> If you set the number of bytes per checksum to zero, 
> {code}    
> conf.setInt(LocalFileSystemConfigKeys.LOCAL_FS_BYTES_PER_CHECKSUM_KEY, 0)
> {code}
> then create a "file://" instance, you get to see a stack trace



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

Reply via email to