@Override
public void onSuccess(final LedgerDescriptor ledgerDescriptor) {
if (LOG.isDebugEnabled()) {
LOG.debug("{} Opened logsegment {} for reading record",
streamName, l);
}
promise.ensure(new AbstractFunction0<BoxedUnit>() {
@Override
public BoxedUnit apply() {
handleCache.asyncCloseLedger(ledgerDescriptor);
return BoxedUnit.UNIT;
}
});
if (LOG.isDebugEnabled()) {
LOG.debug("{} {} scanning {}.", new Object[]{
(backward ? "backward" : "forward"), streamName, l});
}
asyncReadRecordFromLogSegment(
streamName, ledgerDescriptor, handleCache, l, executorService,
scanStartBatchSize, scanMaxBatchSize,
includeControl, includeEndOfStream,
promise, numRecordsScanned, selector, backward, startEntryId);
}