public LedgerEntriesIterator(long ledgerId, long firstEntry, long lastEntry) throws InterruptedException, BKException { this.handle = openLedgerNoRecovery(ledgerId); this.ledgerId = ledgerId; this.nextEntryId = firstEntry; this.lastEntryId = lastEntry; this.currentEntry = null; }
private void listCandidates(List<Long> deletionCandidates, Context context) { for (long ledgerId : deletionCandidates) { try { val lh = context.bkAdmin.openLedgerNoRecovery(ledgerId); output("\tLedger %d: LAC=%d, Length=%d, Bookies=%d, Frags=%d.", ledgerId, lh.getLastAddConfirmed(), lh.getLength(), lh.getNumBookies(), lh.getNumFragments()); } catch (Exception ex) { output("Ledger %d: %s.", ledgerId, ex.getMessage()); } } }
LedgerHandle lh = null; try { lh = admin.openLedgerNoRecovery(ledgerId); if (isLastSegmentOpenAndMissingBookies(lh)) {
try (LedgerHandle lh = admin.openLedgerNoRecovery(ledgerIdToReplicate)) { Set<LedgerFragment> fragments = getUnderreplicatedFragments(lh, conf.getAuditorLedgerVerificationPercentage());