You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by cr...@apache.org on 2025/08/01 06:20:29 UTC

(iotdb) 01/01: RestAPI remove getCurrSessionAndUpdateIdleTime, because RestAPI is not a long connection

This is an automated email from the ASF dual-hosted git repository.

critas pushed a commit to branch wx_fix_restapi
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 03e657fa7d5aff7124d38ec949f75cee849088cb
Author: CritasWang <cr...@outlook.com>
AuthorDate: Fri Aug 1 14:20:06 2025 +0800

    RestAPI remove getCurrSessionAndUpdateIdleTime, because RestAPI is not a long connection
---
 .../iotdb/db/protocol/rest/table/v1/impl/RestApiServiceImpl.java    | 6 +++---
 .../apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java   | 2 +-
 .../apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/table/v1/impl/RestApiServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/table/v1/impl/RestApiServiceImpl.java
index 8d2543b51df..ec0237f13ea 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/table/v1/impl/RestApiServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/table/v1/impl/RestApiServiceImpl.java
@@ -123,7 +123,7 @@ public class RestApiServiceImpl extends RestApiService {
     Statement statement = null;
     long startTime = System.nanoTime();
     try {
-      IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
+      IClientSession clientSession = SESSION_MANAGER.getCurrSession();
       statement = createStatement(sql, clientSession, relationSqlParser);
       Response resp = validateStatement(statement, true);
       if (resp != null) {
@@ -154,7 +154,7 @@ public class RestApiServiceImpl extends RestApiService {
       RequestValidationHandler.validateInsertTabletRequest(insertTabletRequest);
       insertTabletStatement =
           StatementConstructionHandler.constructInsertTabletStatement(insertTabletRequest);
-      IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
+      IClientSession clientSession = SESSION_MANAGER.getCurrSession();
       clientSession.setDatabaseName(insertTabletRequest.getDatabase());
       clientSession.setSqlDialect(IClientSession.SqlDialect.TABLE);
       queryId = SESSION_MANAGER.requestQueryId();
@@ -196,7 +196,7 @@ public class RestApiServiceImpl extends RestApiService {
     Statement statement = null;
     long startTime = System.nanoTime();
     try {
-      IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
+      IClientSession clientSession = SESSION_MANAGER.getCurrSession();
       statement = createStatement(sql, clientSession, relationSqlParser);
       Response resp = validateStatement(statement, false);
       if (resp != null) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
index d7491b6612c..6982fb0b533 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
@@ -112,7 +112,7 @@ public class RestApiServiceImpl extends RestApiService {
             COORDINATOR.executeForTableModel(
                 ((CreateTableViewStatement) statement).getCreateTableView(),
                 new SqlParser(),
-                SESSION_MANAGER.getCurrSessionAndUpdateIdleTime(),
+                SESSION_MANAGER.getCurrSession(),
                 queryId,
                 SESSION_MANAGER.getSessionInfo(SESSION_MANAGER.getCurrSession()),
                 sql.getSql(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
index e9ac41f833d..efdabe0f793 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
@@ -129,7 +129,7 @@ public class RestApiServiceImpl extends RestApiService {
       }
       // Check cache first
       if (!TableDeviceSchemaCache.getInstance().getLastCache(resultMap)) {
-        IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
+        IClientSession clientSession = SESSION_MANAGER.getCurrSession();
         TSLastDataQueryReq tsLastDataQueryReq =
             FastLastHandler.createTSLastDataQueryReq(clientSession, prefixPathList);
         statement = StatementGenerator.createStatement(tsLastDataQueryReq);