sijie commented on a change in pull request #1218: Support LacPiggyback, 
LongPoll and ExplicitLac in db ledger storage
URL: https://github.com/apache/bookkeeper/pull/1218#discussion_r171251262
 
 

 ##########
 File path: 
bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestUtils.java
 ##########
 @@ -52,4 +60,21 @@ public static boolean hasLogFiles(File ledgerDirectory, 
boolean partial, Integer
         }
         return result;
     }
+
+    public static void waitUtilLacUpdated(ReadHandle rh, long newLac) throws 
Exception {
+        long lac = rh.getLastAddConfirmed();
+        while (lac < newLac) {
+            TimeUnit.MILLISECONDS.sleep(20);
+            lac = rh.readLastAddConfirmed().get();
+        }
+    }
+
+    public static long waitUtilExplicitLacUpdated(LedgerHandle rh, long 
newLac) throws Exception {
 
 Review comment:
   I would prefer using new API whenever I can. readExplicitLastAddConfirmed is 
not available in the new API, that forces me going back to LedgerHandle.

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