use of org.apache.accumulo.tserver.scan.LookupTask in project accumulo by apache.
the class ThriftClientHandler method continueMultiScan.
private MultiScanResult continueMultiScan(long scanID, MultiScanSession session) throws TSampleNotPresentException {
if (session.lookupTask == null) {
session.lookupTask = new LookupTask(server, scanID);
server.resourceManager.executeReadAhead(session.threadPoolExtent, getScanDispatcher(session.threadPoolExtent), session, session.lookupTask);
}
try {
MultiScanResult scanResult = session.lookupTask.get(MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS, TimeUnit.MILLISECONDS);
session.lookupTask = null;
return scanResult;
} catch (ExecutionException e) {
server.sessionManager.removeSession(scanID);
if (e.getCause() instanceof SampleNotPresentException) {
throw new TSampleNotPresentException();
} else {
log.warn("Failed to get multiscan result", e);
throw new RuntimeException(e);
}
} catch (TimeoutException e1) {
long timeout = server.getConfiguration().getTimeInMillis(Property.TSERV_CLIENT_TIMEOUT);
server.sessionManager.removeIfNotAccessed(scanID, timeout);
List<TKeyValue> results = Collections.emptyList();
Map<TKeyExtent, List<TRange>> failures = Collections.emptyMap();
List<TKeyExtent> fullScans = Collections.emptyList();
return new MultiScanResult(results, failures, fullScans, null, null, false, true);
} catch (Exception t) {
server.sessionManager.removeSession(scanID);
log.warn("Failed to get multiscan result", t);
throw new RuntimeException(t);
}
}
Aggregations