JackieTien97 commented on code in PR #18035:
URL: https://github.com/apache/iotdb/pull/18035#discussion_r3478735811


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java:
##########
@@ -369,6 +369,23 @@ public IClientSession getCurrSession() {
     return currSession.get();
   }
 
+  /**
+   * Swap the ThreadLocal session and return the previous one. Used by UDF 
internal queries to
+   * temporarily install an internal session without removing the previous 
session from the session
+   * map.
+   */
+  public IClientSession exchangeCurrSession(IClientSession session) {
+    IClientSession previous = currSession.get();
+    if (session != null) {
+      currSession.set(session);
+      sessions.putIfAbsent(session, placeHolder);

Review Comment:
   where did you remove it from `sessions`?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java:
##########
@@ -369,6 +369,23 @@ public IClientSession getCurrSession() {
     return currSession.get();
   }
 
+  /**
+   * Swap the ThreadLocal session and return the previous one. Used by UDF 
internal queries to
+   * temporarily install an internal session without removing the previous 
session from the session
+   * map.
+   */
+  public IClientSession exchangeCurrSession(IClientSession session) {

Review Comment:
   what's the return value used for? if not used, don't call it exchangeXXXX



-- 
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]

Reply via email to