for (Entry<Long,Session> entry : sessions.entrySet()) {
Session session = entry.getValue();
if (session instanceof ScanSession) {
ScanSession ss = (ScanSession) session;
ScanState state = ScanState.RUNNING;
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;
}