private int bkRecovery(BookKeeperAdmin bkAdmin, Set<BookieSocketAddress> bookieAddrs, boolean dryrun, boolean skipOpenLedgers) throws InterruptedException, BKException { bkAdmin.recoverBookieData(bookieAddrs, dryrun, skipOpenLedgers); return 0; }
@Override public void run() { while (!ledgers.isEmpty()) { long lid = -1L; try { lid = ledgers.take(); System.out.println("Recovering ledger " + lid); bkAdmin.recoverBookieData(lid, bookieAddrs, dryrun, skipOpenLedgers); System.out.println("Recovered ledger completed : " + lid + ", " + numPendings.decrementAndGet() + " left"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); doneLatch.countDown(); break; } catch (BKException ke) { System.out.println("Recovered ledger failed : " + lid + ", rc = " + BKException.getMessage(ke.getCode())); } } doneLatch.countDown(); } };
public void recoverBookieData(final Set<BookieSocketAddress> bookiesSrc) throws InterruptedException, BKException { recoverBookieData(bookiesSrc, false, false); }
/** * Synchronous method to rebuild and recover the ledger fragments data that * was stored on the source bookie. That bookie could have failed completely * and now the ledger data that was stored on it is under replicated. An * optional destination bookie server could be given if we want to copy all * of the ledger fragments data on the failed source bookie to it. * Otherwise, we will just randomly distribute the ledger fragments to the * active set of bookies, perhaps based on load. All ZooKeeper ledger * metadata will be updated to point to the new bookie(s) that contain the * replicated ledger fragments. * * @param bookieSrc * Source bookie that had a failure. We want to replicate the * ledger fragments that were stored there. */ public void recoverBookieData(final BookieSocketAddress bookieSrc) throws InterruptedException, BKException { Set<BookieSocketAddress> bookiesSrc = Sets.newHashSet(bookieSrc); recoverBookieData(bookiesSrc); }
private int bkRecovery(BookKeeperAdmin bkAdmin, Set<BookieSocketAddress> bookieAddrs, boolean dryrun, boolean skipOpenLedgers, boolean removeCookies) throws InterruptedException, BKException, KeeperException { bkAdmin.recoverBookieData(bookieAddrs, dryrun, skipOpenLedgers); if (removeCookies) { deleteCookies(bkAdmin.getConf(), bookieAddrs); } return 0; }
private int bkRecoveryLedger(BookKeeperAdmin bkAdmin, long lid, Set<BookieSocketAddress> bookieAddrs, boolean dryrun, boolean skipOpenLedgers, boolean removeCookies) throws InterruptedException, BKException, KeeperException { bkAdmin.recoverBookieData(lid, bookieAddrs, dryrun, skipOpenLedgers); if (removeCookies) { deleteCookies(bkAdmin.getConf(), bookieAddrs); } return 0; }
try { LOG.info("Start recovering bookie."); bka.recoverBookieData(bookieSrc); if (deleteCookie) { Versioned<Cookie> cookie = Cookie.readFromRegistrationManager(rm, bookieSrc);