@@ -71,38 +71,38 @@ public BookieClient getBookieClient() {
7171 return bookieClient ;
7272 }
7373
74- public Future <?> waitForReadOnlyBookie (BookieId b )
74+ public Future <?> waitForReadOnlyBookie (BookieId id )
7575 throws Exception {
76- return waitForBookieInSet (b , false );
76+ return waitForBookieInSet (id , false );
7777 }
7878
79- public Future <?> waitForWritableBookie (BookieId b )
79+ public Future <?> waitForWritableBookie (BookieId id )
8080 throws Exception {
81- return waitForBookieInSet (b , true );
81+ return waitForBookieInSet (id , true );
8282 }
8383
8484 /**
8585 * Wait for bookie to appear in either the writable set of bookies,
8686 * or the read only set of bookies. Also ensure that it doesn't exist
8787 * in the other set before completing.
8888 */
89- private Future <?> waitForBookieInSet (BookieId b ,
89+ private Future <?> waitForBookieInSet (BookieId id ,
9090 boolean writable ) throws Exception {
9191 log .info ("Wait for {} to become {}" ,
92- b , writable ? "writable" : "readonly" );
92+ id , writable ? "writable" : "readonly" );
9393
9494 CompletableFuture <Void > readOnlyFuture = new CompletableFuture <>();
9595 CompletableFuture <Void > writableFuture = new CompletableFuture <>();
9696
9797 RegistrationListener readOnlyListener = (bookies ) -> {
98- boolean contains = bookies .getValue ().contains (b );
99- if ((!writable && contains ) || (writable && !contains )) {
98+ boolean containsId = bookies .getValue ().contains (id );
99+ if ((!writable && containsId ) || (writable && !containsId )) {
100100 readOnlyFuture .complete (null );
101101 }
102102 };
103103 RegistrationListener writableListener = (bookies ) -> {
104- boolean contains = bookies .getValue ().contains (b );
105- if ((writable && contains ) || (!writable && !contains )) {
104+ boolean containsId = bookies .getValue ().contains (id );
105+ if ((writable && containsId ) || (!writable && !containsId )) {
106106 writableFuture .complete (null );
107107 }
108108 };
@@ -114,7 +114,7 @@ private Future<?> waitForBookieInSet(BookieId b,
114114 return writableFuture
115115 .thenCompose (ignored -> getMetadataClientDriver ().getRegistrationClient ().getReadOnlyBookies ())
116116 .thenCompose (readonlyBookies -> {
117- if (readonlyBookies .getValue ().contains (b )) {
117+ if (readonlyBookies .getValue ().contains (id )) {
118118 // if the bookie still shows up at readonly path, wait for it to disappear
119119 return readOnlyFuture ;
120120 } else {
@@ -125,7 +125,7 @@ private Future<?> waitForBookieInSet(BookieId b,
125125 return readOnlyFuture
126126 .thenCompose (ignored -> getMetadataClientDriver ().getRegistrationClient ().getWritableBookies ())
127127 .thenCompose (writableBookies -> {
128- if (writableBookies .getValue ().contains (b )) {
128+ if (writableBookies .getValue ().contains (id )) {
129129 // if the bookie still shows up at writable path, wait for it to disappear
130130 return writableFuture ;
131131 } else {
@@ -139,7 +139,7 @@ private Future<?> waitForBookieInSet(BookieId b,
139139 * Force a read to zookeeper to get list of bookies.
140140 *
141141 * @throws InterruptedException
142- * @throws KeeperException
142+ * @throws BKException
143143 */
144144 public void readBookiesBlocking () throws InterruptedException , BKException {
145145 bookieWatcher .initialBlockingBookieRead ();
0 commit comments