hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajay Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15109) TestDFSIO -read -random doesn't work on file sized 4GB
Date Thu, 14 Dec 2017 16:51:00 GMT

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

Ajay Kumar commented on HADOOP-15109:
-------------------------------------

[~zhoutai.zt], thanks for review.

> TestDFSIO -read -random doesn't work on file sized 4GB
> ------------------------------------------------------
>
>                 Key: HADOOP-15109
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15109
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, test
>    Affects Versions: 3.0.0-beta1
>            Reporter: zhoutai.zt
>            Assignee: Ajay Kumar
>            Priority: Minor
>         Attachments: HADOOP-15109.001.patch, HADOOP-15109.002.patch, Screen Shot 2017-12-11
at 3.17.22 PM.png
>
>
> TestDFSIO -read -random throws IllegalArgumentException on 4GB file. The cause is:
> {code:java}
> private long nextOffset(long current) {
>       if(skipSize == 0)
>         return rnd.nextInt((int)(fileSize));
>       if(skipSize > 0)
>         return (current < 0) ? 0 : (current + bufferSize + skipSize);
>       // skipSize < 0
>       return (current < 0) ? Math.max(0, fileSize - bufferSize) :
>                              Math.max(0, current + skipSize);
>     }
>   }
> {code}
> When {color:#d04437}_filesize_{color} exceeds signed int, (int)(filesize) will be negative
and cause Random.nextInt throws  IllegalArgumentException("n must be positive").



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message