merlimat commented on a change in pull request #1799: 
BlockAwareSegmentInputStreamImpl shouldn't use LedgerEntry#getLength
URL: https://github.com/apache/incubator-pulsar/pull/1799#discussion_r189778940
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/s3offload/impl/BlockAwareSegmentInputStreamImpl.java
 ##########
 @@ -122,14 +122,15 @@ private int readEntries() throws IOException {
             Iterator<LedgerEntry> iterator = ledgerEntriesOnce.iterator();
             while (iterator.hasNext()) {
                 LedgerEntry entry = iterator.next();
-                int entryLength = (int) entry.getLength();
+                ByteBuf buf = entry.getEntryBuffer().retain();
 
 Review comment:
   Yes, this is having the same net sum as before this change. My concern was 
around the `LedgerEntry` themselves. When we call `getEntryBuffer()` the 
entries are not automatically released. Eg: if we were to remove the 
`CompositeByteBuf` we still would have to do a release on the entry.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to