hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo (Nicholas), SZE (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-691) Limitation on java.io.InputStream.available()
Date Wed, 28 Oct 2009 18:41:59 GMT

    [ https://issues.apache.org/jira/browse/HDFS-691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771046#action_12771046

Tsz Wo (Nicholas), SZE commented on HDFS-691:

    public synchronized int available() throws IOException {
      if (closed) {
        throw new IOException("Stream closed");
      return (int) (getFileLength() - pos);

There are two problems associated with this issue:

# If the available bytes is >= 2GB, we will lose the higher bits of the value since the
value is casted from long to int.
# We may need a new API to get the available bytes as a long.  This API is useful with hflush().

I will fix the first problem in this issue.

> Limitation on java.io.InputStream.available()
> ---------------------------------------------
>                 Key: HDFS-691
>                 URL: https://issues.apache.org/jira/browse/HDFS-691
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs client
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
> java.io.InputStream.available() returns an int which has the max value 2^31-1 = 2GB -
1B.  It won't work if the number of available bytes is >= 2GB.

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

View raw message