use of org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException in project accumulo by apache.
the class NextBatchTask method run.
@Override
public void run() {
final SingleScanSession scanSession = (SingleScanSession) server.getSession(scanID);
String oldThreadName = Thread.currentThread().getName();
try {
if (isCancelled() || scanSession == null)
return;
runState.set(ScanRunState.RUNNING);
Thread.currentThread().setName("User: " + scanSession.getUser() + " Start: " + scanSession.startTime + " Client: " + scanSession.client + " Tablet: " + scanSession.extent);
Tablet tablet = server.getOnlineTablet(scanSession.extent);
if (tablet == null) {
addResult(new org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException(scanSession.extent.toThrift()));
return;
}
ScanBatch batch = scanSession.scanner.read();
// there should only be one thing on the queue at a time, so
// it should be ok to call add()
// instead of put()... if add() fails because queue is at
// capacity it means there is code
// problem somewhere
addResult(batch);
} catch (TabletClosedException e) {
addResult(new org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException(scanSession.extent.toThrift()));
} catch (IterationInterruptedException iie) {
if (!isCancelled()) {
log.warn("Iteration interrupted, when scan not cancelled", iie);
addResult(iie);
}
} catch (TooManyFilesException | SampleNotPresentException e) {
addResult(e);
} catch (IOException | RuntimeException e) {
log.warn("exception while scanning tablet {} for {}", scanSession.extent, scanSession.client, e);
addResult(e);
} finally {
runState.set(ScanRunState.FINISHED);
Thread.currentThread().setName(oldThreadName);
}
}
Aggregations