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

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

commit 42dca3bd72f2640f834515a67423c28596476304
Author: Samuel Just <[email protected]>
AuthorDate: Mon Jan 8 16:10:45 2018 -0800

    BookieProtoEncoding: use retainedSlice() to reduce garbage
    
    Signed-off-by: Samuel Just <sjustsalesforce.com>
    
    Author: Samuel Just <[email protected]>
    
    Reviewers: Sijie Guo <[email protected]>, Matteo Merli <[email protected]>
    
    This closes #940 from athanatos/forupstream/requestprocessorfixes/3
---
 .../main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
index df7f3b2..4f2b142 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
@@ -278,8 +278,8 @@ public class BookieProtoEncoding {
                 entryId = buffer.readLong();
 
                 if (rc == BookieProtocol.EOK) {
-                    ByteBuf content = buffer.slice();
-                    return new BookieProtocol.ReadResponse(version, rc, 
ledgerId, entryId, content.retain());
+                    return new BookieProtocol.ReadResponse(version, rc,
+                                                           ledgerId, entryId, 
buffer.retainedSlice());
                 } else {
                     return new BookieProtocol.ReadResponse(version, rc, 
ledgerId, entryId);
                 }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to