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

 ##########
 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:
   Thanks. will change the comments, this is in try block, so close will called 
automatically. added verify in LedgerEntriesImplTest.tearDown
   ```
       public void tearDown() {
           ledgerEntriesImpl.close();
           // References should be released after close.
           bufs.forEach(byteBuf -> assertEquals(0, byteBuf.refCnt()));
   
   ```

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