You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2019/12/02 22:09:03 UTC

[GitHub] [bookkeeper] Ghatage commented on a change in pull request #2203: Issue #609 Add indexDirs field to cookie

Ghatage commented on a change in pull request #2203: Issue #609 Add indexDirs field to cookie
URL: https://github.com/apache/bookkeeper/pull/2203#discussion_r352885205
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
 ##########
 @@ -124,14 +127,28 @@ private boolean verifyLedgerDirs(Cookie c, boolean checkIfSuperSet) {
         }
     }
 
-    private void verifyInternal(Cookie c, boolean checkIfSuperSet) throws BookieException.InvalidCookieException {
+    private boolean verifyIndexDirs(Cookie c, boolean checkIfSuperSet, boolean enforceCookieIndexDirCheck) {
+        if (!enforceCookieIndexDirCheck) {
+            return true;
+        }
+
+        if (!checkIfSuperSet) {
+            return indexDirs.equals(c.indexDirs);
+        } else {
+            return isSuperSet(decodeDirPathFromCookie(indexDirs), decodeDirPathFromCookie(c.indexDirs));
+        }
+    }
+
+    private void verifyInternal(Cookie c, boolean checkIfSuperSet, ServerConfiguration conf) throws BookieException.InvalidCookieException {
 
 Review comment:
   I passed a conf object for future cookie changes that we bring in, viz. network location for 3AZ work we are doing. 
   A conf object would make it easier than to refactor the function definition to accept yet another boolean.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services