hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-8499) Cell BaseDecoder may be using inputstream incorrectly
Date Mon, 06 May 2013 22:48:16 GMT
Sergey Shelukhin created HBASE-8499:
---------------------------------------

             Summary: Cell BaseDecoder may be using inputstream incorrectly
                 Key: HBASE-8499
                 URL: https://issues.apache.org/jira/browse/HBASE-8499
             Project: HBase
          Issue Type: Bug
            Reporter: Sergey Shelukhin
            Priority: Minor


{code}
    if (this.in.available() <= 0) {
      this.hasNext = false;
      return this.hasNext;
    }
{code}

Javadoc for available:
{quote}
Returns an estimate of the number of bytes that can be read (or skipped over) from this input
stream without blocking by the next invocation of a method for this input stream. The next
invocation might be the same thread or another thread. A single read or skip of this many
bytes will not block, but may read or skip fewer bytes.

Note that while some implementations of InputStream will return the total number of bytes
in the stream, many will not.
{quote}

Not a big deal if we always use it with correct streams now, but rather dangerous.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message