File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 2020package org .apache .iotdb .db .protocol .session ;
2121
2222import org .apache .iotdb .commons .conf .IoTDBConstant .ClientVersion ;
23+ import org .apache .iotdb .commons .utils .CommonDateTimeUtils ;
2324import org .apache .iotdb .db .queryengine .common .ConnectionInfo ;
2425import org .apache .iotdb .service .rpc .thrift .TSConnectionInfo ;
2526import org .apache .iotdb .service .rpc .thrift .TSConnectionType ;
@@ -57,7 +58,7 @@ public abstract class IClientSession {
5758
5859 @ Nullable private String databaseName ;
5960
60- private long lastActiveTime ;
61+ private long lastActiveTime = CommonDateTimeUtils . currentTime () ;
6162
6263 public abstract String getClientAddress ();
6364
Original file line number Diff line number Diff line change @@ -497,8 +497,8 @@ public void supplySession(
497497 session .setUsername (username );
498498 session .setZoneId (zoneId );
499499 session .setClientVersion (clientVersion );
500- session .setLogin (true );
501500 session .setLogInTime (System .currentTimeMillis ());
501+ session .setLogin (true );
502502 }
503503
504504 public void closeDataset (
@@ -581,7 +581,7 @@ public TSConnectionInfoResp getAllConnectionInfo() {
581581
582582 public List <ConnectionInfo > getAllSessionConnectionInfo () {
583583 return sessions .keySet ().stream ()
584- .filter (s -> StringUtils .isNotEmpty (s .getUsername ()))
584+ .filter (s -> StringUtils .isNotEmpty (s .getUsername ()) && s . isLogin () )
585585 .map (IClientSession ::convertToConnectionInfo )
586586 .sorted (Comparator .comparingLong (ConnectionInfo ::getLastActiveTime ))
587587 .collect (Collectors .toList ());
You can’t perform that action at this time.
0 commit comments