@Override
public boolean ledgerExists(long ledgerId) throws IOException {
// Done this way because checking the skip list is an O(logN) operation compared to
// the O(1) for the ledgerCache.
if (!interleavedLedgerStorage.ledgerExists(ledgerId)) {
EntryKeyValue kv = memTable.getLastEntry(ledgerId);
if (null == kv) {
return interleavedLedgerStorage.ledgerExists(ledgerId);
}
}
return true;
}
I want to know why calculate ledgerExists() two times? Thanks
Original Issue: apache/bookkeeper#2770
Class SortedLedgerStorage, method ledgerExists
I want to know why calculate ledgerExists() two times? Thanks