RunnableFuture<ScanBatch> nbt = ss.nextBatchTask;
if (nbt == null || nbt.isDone() || nbt.isCancelled()) {
state = ScanState.IDLE;
}
activeScans.add(new ActiveScan(ss.client, ss.user, ss.extent.getTableId().toString(), ct - ss.startTime, ct - ss.lastAccessTime, ScanType.SINGLE,
state, ss.extent.toThrift(), Translator.translate(ss.columnSet, Translator.CT), ss.ssiList, ss.ssio));
} else if (session instanceof MultiScanSession) {
MultiScanSession mss = (MultiScanSession) session;
ScanState state = ScanState.RUNNING;
RunnableFuture<MultiScanResult> nbt = mss.lookupTask;
if (nbt == null || nbt.isDone() || nbt.isCancelled()) {
state = ScanState.IDLE;
}
activeScans.add(new ActiveScan(mss.client, mss.user, mss.threadPoolExtent.getTableId().toString(), ct - mss.startTime, ct - mss.lastAccessTime,
ScanType.BATCH, state, mss.threadPoolExtent.toThrift(), Translator.translate(mss.columnSet, Translator.CT), mss.ssiList, mss.ssio));
}
}
return activeScans;