HADOOP-11039. ByteBufferReadable API doc is inconsistent with the implementations. (Yi Liu via Colin P. McCabe)

(cherry picked from commit 249cc90501)
This commit is contained in:
Colin Patrick Mccabe 2014-12-29 13:37:45 -08:00
parent e5cb52ec1f
commit e25b789b19
2 changed files with 8 additions and 6 deletions

View File

@ -307,6 +307,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11448. Fix findbugs warnings in FileBasedIPList. (ozawa) HADOOP-11448. Fix findbugs warnings in FileBasedIPList. (ozawa)
HADOOP-11039. ByteBufferReadable API doc is inconsistent with the
implementations. (Yi Liu via Colin P. McCabe)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -29,9 +29,8 @@ public interface ByteBufferReadable {
* Reads up to buf.remaining() bytes into buf. Callers should use * Reads up to buf.remaining() bytes into buf. Callers should use
* buf.limit(..) to control the size of the desired read. * buf.limit(..) to control the size of the desired read.
* <p/> * <p/>
* After a successful call, buf.position() and buf.limit() should be * After a successful call, buf.position() will be advanced by the number
* unchanged, and therefore any data can be immediately read from buf. * of bytes read and buf.limit() should be unchanged.
* buf.mark() may be cleared or updated.
* <p/> * <p/>
* In the case of an exception, the values of buf.position() and buf.limit() * In the case of an exception, the values of buf.position() and buf.limit()
* are undefined, and callers should be prepared to recover from this * are undefined, and callers should be prepared to recover from this
@ -45,9 +44,9 @@ public interface ByteBufferReadable {
* signal an error upon their receipt. * signal an error upon their receipt.
* *
* @param buf * @param buf
* the ByteBuffer to receive the results of the read operation. Up to * the ByteBuffer to receive the results of the read operation.
* buf.limit() - buf.position() bytes may be read. * @return the number of bytes read, possibly zero, or -1 if
* @return the number of bytes available to read from buf * reach end-of-stream
* @throws IOException * @throws IOException
* if there is some error performing the read * if there is some error performing the read
*/ */