sijie commented on a change in pull request #641: Issue-596 Issue-583: Auto
replication should honor ensemble placement policy
URL: https://github.com/apache/bookkeeper/pull/641#discussion_r146359096
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
##########
@@ -739,19 +684,40 @@ public void openComplete(int rc, final LedgerHandle lh,
Object ctx) {
asyncOpenLedger(lId, new OpenCallback() {
@Override
public void openComplete(int newrc, final
LedgerHandle newlh, Object newctx) {
- if (newrc != Code.OK.intValue()) {
+ if (newrc != BKException.Code.OK) {
LOG.error("BK error close ledger: " + lId,
BKException.create(newrc));
- ledgerIterCb.processResult(newrc, null,
null);
+ finalLedgerIterCb.processResult(newrc,
null, null);
return;
}
- // do recovery
- recoverLedger(bookieSrc, lId, ledgerIterCb,
availableBookies);
+ bkc.mainWorkerPool.submit(() -> {
+ // do recovery
+ recoverLedger(bookiesSrc, lId, dryrun,
skipOpenLedgers, finalLedgerIterCb);
+ });
}
}, null);
return;
}
}
+ final AsyncCallback.VoidCallback ledgerIterCb = new
AsyncCallback.VoidCallback() {
Review comment:
I don't think it is worth a util method, because the logging info is more
recover related. we can improve it using lambda and completable future in
future.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services