You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/12/20 16:16:10 UTC

[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3680: [fix][server] When dbStorage_directIOEntryLogger=true, EntryLogIdsImpl only takes effect for a single ledger directory

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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org