use of org.apache.distributedlog.logsegment.LogSegmentEntryReader in project bookkeeper by apache.
the class BKLogSegmentEntryStore method openComplete.
@Override
public void openComplete(int rc, LedgerHandle lh, Object ctx) {
OpenReaderRequest request = (OpenReaderRequest) ctx;
if (BKException.Code.OK != rc) {
FutureUtils.completeExceptionally(request.openPromise, new BKTransmitException("Failed to open ledger handle for log segment " + request.segment, rc));
return;
}
// successfully open a ledger
try {
LogSegmentEntryReader reader = new BKLogSegmentEntryReader(request.segment, lh, request.startEntryId, bkc.get(), scheduler, conf, statsLogger, failureInjector);
FutureUtils.complete(request.openPromise, reader);
} catch (IOException e) {
FutureUtils.completeExceptionally(request.openPromise, e);
}
}
Aggregations