kevinrr888 commented on code in PR #4871:
URL: https://github.com/apache/accumulo/pull/4871#discussion_r1754825248
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java:
##########
@@ -453,83 +453,64 @@ public List<ActiveScan> getActiveScans() {
final Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<>();
/**
- * Add sessions so that get the list returned in the active scans call
+ * Add sessions that get the list returned in the active scans call
*/
for (Session session : deferredCleanupQueue) {
copiedIdleSessions.add(Maps.immutableEntry(expiredSessionMarker,
session));
}
List.of(sessions.entrySet(), copiedIdleSessions).forEach(s ->
s.forEach(entry -> {
Session session = entry.getValue();
- if (session instanceof SingleScanSession) {
- SingleScanSession ss = (SingleScanSession) session;
-
- ScanState state = ScanState.RUNNING;
-
- ScanTask<ScanBatch> nbt = ss.getScanTask();
- if (nbt == null) {
- state = ScanState.IDLE;
- } else {
- switch (nbt.getScanRunState()) {
- case QUEUED:
- state = ScanState.QUEUED;
- break;
- case FINISHED:
- state = ScanState.IDLE;
- break;
- case RUNNING:
- default:
- /* do nothing */
- break;
- }
- }
- var params = ss.scanParams;
- ActiveScan activeScan = new ActiveScan(ss.client, ss.getUser(),
- ss.extent.tableId().canonical(), ct - ss.startTime, ct -
ss.lastAccessTime,
- ScanType.SINGLE, state, ss.extent.toThrift(),
-
params.getColumnSet().stream().map(Column::toThrift).collect(Collectors.toList()),
- params.getSsiList(), params.getSsio(),
params.getAuthorizations().getAuthorizationsBB(),
- params.getClassLoaderContext());
+ if (session instanceof ScanSession) {
+ ScanSession<?> scanSession = (ScanSession<?>) session;
Review Comment:
cast needed for `ScanSession.getScanTask()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]