eolivelli commented on a change in pull request #727: Issue 693: add interface 
and implementation of LedgerEntries
URL: https://github.com/apache/bookkeeper/pull/727#discussion_r152738635
 
 

 ##########
 File path: 
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/api/BookKeeperApiTest.java
 ##########
 @@ -275,11 +276,13 @@ public void testCannotDeleteLedgerTwice() throws 
Exception {
         result(newDeleteLedgerOp().withLedgerId(lId).execute());
     }
 
-    private static void checkEntries(Iterable<LedgerEntry> entries, byte[] 
data)
+    private static void checkEntries(LedgerEntries entries, byte[] data)
         throws InterruptedException, BKException {
-        for (LedgerEntry le : entries) {
-            assertArrayEquals(data, le.getEntry());
+        Iterator<LedgerEntry> iterator = entries.iterator();
+        while(iterator.hasNext()) {
+            LedgerEntry entry = iterator.next();
+            // since getEntry() will call ByteBuf release, so no need release 
here.
 
 Review comment:
   this is clear but maybe it is better to call always call "close".
   two motivations:
   - close lets the reclycler to work, maybe it is not a real issue
   - please use simple test cases as this as a code example
   
   please take into account this comment but it is not a real problem

----------------------------------------------------------------
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