You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by gi...@git.apache.org on 2017/06/29 13:54:09 UTC

[GitHub] jvrao commented on a change in pull request #205: Issue 208: Improve ledger fence logic

jvrao commented on a change in pull request #205: Issue 208: Improve ledger fence logic
URL: https://github.com/apache/bookkeeper/pull/205#discussion_r124805643
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/IndexPersistenceMgr.java
 ##########
 @@ -177,7 +177,35 @@ private FileInfo putFileInfo(Long ledger, byte masterKey[], File lf, boolean cre
      */
     private File getNewLedgerIndexFile(Long ledger, File excludedDir)
                     throws NoWritableLedgerDirException {
-        File dir = ledgerDirsManager.pickRandomWritableDir(excludedDir);
+        return getNewLedgerIndexFile(ledger, excludedDir, false);
+    }
+
+    /**
+     * Get a new index file for a ledger in a lazy way.
+     *
+     + <p>If fallback is false, this function will throw exception when there are no writable dirs.
+     + If fallback is true and there's no writable dirs, it will ignore the error and pick any dir.
+     + Set fallback to true is useful when we want to delay disk check and just get the File pointer, e.g. fence ledger
+     *
+     * @param ledger
+     *          Ledger id.
+     * @param excludedDir
+     *          The ledger directory to exclude.
 
 Review comment:
   Add new @param fallback here.
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services