You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sh...@apache.org on 2022/06/30 12:05:42 UTC

[flink] branch master updated: [FLINK-28290][sql-gateway] Set lastAccessTime when create the Session Object (#20107)

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

shengkai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new ac94fa1e9f3 [FLINK-28290][sql-gateway] Set lastAccessTime when create the Session Object (#20107)
ac94fa1e9f3 is described below

commit ac94fa1e9f32ef25c665bc167146bede73b46afd
Author: Shengkai <33...@users.noreply.github.com>
AuthorDate: Thu Jun 30 20:05:26 2022 +0800

    [FLINK-28290][sql-gateway] Set lastAccessTime when create the Session Object (#20107)
---
 .../java/org/apache/flink/table/gateway/service/session/Session.java   | 1 +
 .../apache/flink/table/gateway/service/result/ResultFetcherTest.java   | 3 ++-
 .../apache/flink/table/gateway/service/session/SessionManagerTest.java | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/session/Session.java b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/session/Session.java
index 57cb04dbc25..2369aea247e 100644
--- a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/session/Session.java
+++ b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/session/Session.java
@@ -39,6 +39,7 @@ public class Session implements Closeable {
 
     public Session(SessionContext sessionContext) {
         this.sessionContext = sessionContext;
+        this.lastAccessTime = System.currentTimeMillis();
     }
 
     public void touch() {
diff --git a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/result/ResultFetcherTest.java b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/result/ResultFetcherTest.java
index fc228241613..2acaa03cd81 100644
--- a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/result/ResultFetcherTest.java
+++ b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/result/ResultFetcherTest.java
@@ -30,6 +30,7 @@ import org.apache.flink.table.gateway.api.results.ResultSet;
 import org.apache.flink.table.gateway.api.utils.SqlGatewayException;
 import org.apache.flink.types.RowKind;
 import org.apache.flink.util.CloseableIterator;
+import org.apache.flink.util.TestLogger;
 
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.junit.jupiter.api.BeforeAll;
@@ -52,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /** Test for {@link ResultFetcher}. */
-public class ResultFetcherTest {
+public class ResultFetcherTest extends TestLogger {
 
     private static ResolvedSchema schema;
     private static List<RowData> data;
diff --git a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/session/SessionManagerTest.java b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/session/SessionManagerTest.java
index ae4ff66cd81..84f538155c3 100644
--- a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/session/SessionManagerTest.java
+++ b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/session/SessionManagerTest.java
@@ -27,6 +27,7 @@ import org.apache.flink.table.gateway.api.session.SessionHandle;
 import org.apache.flink.table.gateway.api.utils.MockedEndpointVersion;
 import org.apache.flink.table.gateway.api.utils.SqlGatewayException;
 import org.apache.flink.table.gateway.service.context.DefaultContext;
+import org.apache.flink.util.TestLogger;
 
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
@@ -40,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /** Test for {@link SessionManager}. */
-public class SessionManagerTest {
+public class SessionManagerTest extends TestLogger {
 
     private SessionManager sessionManager;