try {
w.addRequest(new LSMDBRequest<ResultSet<byte[], byte[]>>(
lsmDB, indexId, result, from, to, ascending));
} catch (InterruptedException ex) {
result.failed(new BabuDBException(ErrorCode.INTERRUPTED,
"operation was interrupted", ex));
}
}
// otherwise, perform a direct range lookup
else {
if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0))
result.failed(new BabuDBException(ErrorCode.NO_SUCH_INDEX,
"index does not exist"));
else
result.finished(lsmDB.getIndex(indexId).rangeLookup(from, to,
ascending));
}