/** * Inititates the ledger open operation without recovery. */ public void initiateWithoutRecovery() { this.doRecovery = false; initiate(); }
private void open(OpenCallback cb) { final int validateRc = validate(); if (Code.OK != validateRc) { cb.openComplete(validateRc, null, null); return; } LedgerOpenOp op = new LedgerOpenOp(bk, bk.getClientCtx().getClientStats(), ledgerId, fromApiDigestType(digestType), password, cb, null); ReentrantReadWriteLock closeLock = bk.getCloseLock(); closeLock.readLock().lock(); try { if (bk.isClosed()) { cb.openComplete(BKException.Code.ClientClosedException, null, null); return; } if (recovery) { op.initiate(); } else { op.initiateWithoutRecovery(); } } finally { closeLock.readLock().unlock(); } } }
lId, digestType, passwd, cb, ctx).initiate(); } finally { closeLock.readLock().unlock();
/** * Open a ledger as an administrator. This means that no digest password * checks are done. Otherwise, the call is identical to BookKeeper#asyncOpenLedger * * @param lId * ledger identifier * @param cb * Callback which will receive a LedgerHandle object * @param ctx * optional context object, to be passwd to the callback (can be null) * * @see BookKeeper#asyncOpenLedger */ public void asyncOpenLedger(final long lId, final OpenCallback cb, final Object ctx) { new LedgerOpenOp(bkc, bkc.getClientCtx().getClientStats(), lId, cb, ctx).initiate(); }
/** * Open a ledger as an administrator. This means that no digest password * checks are done. Otherwise, the call is identical to * BookKeeper#openLedger * * @param lId * - ledger identifier * @see BookKeeper#openLedger */ public LedgerHandle openLedger(final long lId) throws InterruptedException, BKException { CompletableFuture<LedgerHandle> future = new CompletableFuture<>(); SyncOpenCallback result = new SyncOpenCallback(future); new LedgerOpenOp(bkc, bkc.getClientCtx().getClientStats(), lId, result, null).initiate(); return SyncCallbackUtils.waitForResult(future); }