diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ByteBufferPool.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ByteBufferPool.java index bb2c978e09..aa5f8731c5 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ByteBufferPool.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ByteBufferPool.java @@ -31,7 +31,7 @@ public interface ByteBufferPool { * new buffer. * * @param direct Whether the buffer should be direct. - * @param minLength The minimum length the buffer will have. + * @param length The minimum length the buffer will have. * @return A new ByteBuffer. This ByteBuffer must be direct. * Its capacity can be less than what was requested, but * must be at least 1 byte. diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ElasticByteBufferPool.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ElasticByteBufferPool.java index f1ea9ff6b5..c4b4491ec3 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ElasticByteBufferPool.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/ElasticByteBufferPool.java @@ -52,6 +52,16 @@ public int compareTo(Key other) { compare(insertionTime, other.insertionTime). result(); } + + @Override + public boolean equals(Object rhs) { + try { + Key o = (Key)rhs; + return (compareTo(o) == 0); + } catch (ClassCastException e) { + return false; + } + } } private final TreeMap buffers = diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4949.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4949.txt index 51af0b7aa3..cc6737bc97 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4949.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4949.txt @@ -64,3 +64,5 @@ HDFS-4949 (Unreleased) HDFS-5210. Fix some failing unit tests on HDFS-4949 branch. (Contributed by Andrew Wang) + + HDFS-5266. ElasticByteBufferPool#Key does not implement equals. (cnauroth)