You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by eo...@apache.org on 2018/01/18 01:49:20 UTC

[bookkeeper] branch branch-4.6 updated: revert DoubleByteBuf niobuffers() changes

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch branch-4.6
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/branch-4.6 by this push:
     new 6149db1  revert DoubleByteBuf niobuffers() changes
6149db1 is described below

commit 6149db18a68569c699ce4877956b1ad6338985dc
Author: Sebastian Schepens <se...@mercadolibre.com>
AuthorDate: Thu Jan 18 02:48:58 2018 +0100

    revert DoubleByteBuf niobuffers() changes
    
    Revert some of the changes in https://github.com/apache/bookkeeper/pull/996 since they cause issues
    
    Author: Sebastian Schepens <se...@mercadolibre.com>
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>, Sijie Guo <si...@apache.org>
    
    This closes #998 from sschepens/double-bytebuf-fix-2
    
    (cherry picked from commit 9fca590d94bea9bf86a49f1dbdddf2ae37d3e949)
    Signed-off-by: Enrico Olivelli <eo...@apache.org>
---
 .../src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java      | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java
index d38205c..c254d40 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/DoubleByteBuf.java
@@ -393,10 +393,7 @@ public final class DoubleByteBuf extends AbstractReferenceCountedByteBuf {
 
     @Override
     public ByteBuffer[] nioBuffers() {
-        if (b1.nioBufferCount() == 1 && b2.nioBufferCount() == 1) {
-            return new ByteBuffer[] { b1.nioBuffer(), b2.nioBuffer() };
-        }
-        return ObjectArrays.concat(b1.nioBuffers(), b2.nioBuffers(), ByteBuffer.class);
+        return nioBuffers(readerIndex(), readableBytes());
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <co...@bookkeeper.apache.org>'].