hangc0276 commented on code in PR #3680:
URL: https://github.com/apache/bookkeeper/pull/3680#discussion_r1053499874


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/TestEntryLogIds.java:
##########
@@ -127,6 +128,52 @@ public void testNoStompingDirectStartsFirst() throws 
Exception {
         highestSoFar = logId4;
     }
 
+    @Test
+    public void testIdGenerator() throws Exception {
+        File base = tmpDirs.createNew("entryLogIds", "ledgers");
+        File ledgerDir1 = new File(base, "l1");
+        File ledgerDir2 = new File(base, "l2");
+        File ledgerDir3 = new File(base, "l3");
+        File ledgerDir4 = new File(base, "l4");
+        ledgerDir1.mkdir();
+        ledgerDir2.mkdir();
+        ledgerDir3.mkdir();
+        ledgerDir4.mkdir();
+
+        //case 1: use root ledgerDirsManager
+        LedgerDirsManager ledgerDirsManager = newDirsManager(ledgerDir1, 
ledgerDir2);
+        EntryLogIds ids1 = new EntryLogIdsImpl(ledgerDirsManager, slog);
+        for (int i = 0; i < 10; i++) {
+            int logId = ids1.nextId();
+            File log1 = new File(ledgerDir1 + "/current", logId + ".log");

Review Comment:
   We just need to check `logId`, and do not need to create new files.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to