|
@@ -149,13 +149,16 @@ class BKJMUtil {
|
|
int checkBookiesUp(int count, int timeout) throws Exception {
|
|
int checkBookiesUp(int count, int timeout) throws Exception {
|
|
ZooKeeper zkc = connectZooKeeper();
|
|
ZooKeeper zkc = connectZooKeeper();
|
|
try {
|
|
try {
|
|
- boolean up = false;
|
|
|
|
int mostRecentSize = 0;
|
|
int mostRecentSize = 0;
|
|
for (int i = 0; i < timeout; i++) {
|
|
for (int i = 0; i < timeout; i++) {
|
|
try {
|
|
try {
|
|
List<String> children = zkc.getChildren("/ledgers/available",
|
|
List<String> children = zkc.getChildren("/ledgers/available",
|
|
false);
|
|
false);
|
|
mostRecentSize = children.size();
|
|
mostRecentSize = children.size();
|
|
|
|
+ // Skip 'readonly znode' which is used for keeping R-O bookie details
|
|
|
|
+ if (children.contains("readonly")) {
|
|
|
|
+ mostRecentSize = children.size() - 1;
|
|
|
|
+ }
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("Found " + mostRecentSize + " bookies up, "
|
|
LOG.debug("Found " + mostRecentSize + " bookies up, "
|
|
+ "waiting for " + count);
|
|
+ "waiting for " + count);
|
|
@@ -166,7 +169,6 @@ class BKJMUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (mostRecentSize == count) {
|
|
if (mostRecentSize == count) {
|
|
- up = true;
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} catch (KeeperException e) {
|
|
} catch (KeeperException e) {
|