sijie commented on a change in pull request #1281: Issue #570: Introducing 
EntryLogManager.
URL: https://github.com/apache/bookkeeper/pull/1281#discussion_r180525552
 
 

 ##########
 File path: 
bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java
 ##########
 @@ -93,16 +98,16 @@ public void testCreateNewLog() throws Exception {
         // Extracted from createNewLog()
         String logFileName = Long.toHexString(1) + ".log";
         File dir = ledgerDirsManager.pickRandomWritableDir();
-        LOG.info("Picked this directory: " + dir);
+        LOG.info("Picked this directory: {}", dir);
         File newLogFile = new File(dir, logFileName);
         newLogFile.createNewFile();
 
         EntryLogger el = new EntryLogger(conf, ledgerDirsManager);
         // Calls createNewLog, and with the number of directories we
         // are using, if it picks one at random it will fail.
-        el.createNewLog();
-        LOG.info("This is the current log id: " + el.getCurrentLogId());
-        assertTrue("Wrong log id", el.getCurrentLogId() > 1);
+        ((EntryLogManagerBase) el.entryLogManager).createNewLog(0L);
 
 Review comment:
   - nit: provide a `getEntryLogManager` in EntryLogger. so we can mock it in 
future if needed.
   - better to cast to `SingleEntryLogManager`. because you can expose 
`getCurrentLogId` in `SingleEntryLogManager`.
   
   ```
   SingleEntryLogManager selm = (SingleEntryLogManager) 
(el.getEntryLogManager());
   selm.createNewLog(0L);
   assertTrue(selm.getCurrentLogId() > 1);
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to