You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2025/11/20 10:27:50 UTC
(paimon) branch master updated: [core] Expire after access 10 hours in RESTTokenFileIO
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 2a7e7ff1d5 [core] Expire after access 10 hours in RESTTokenFileIO
2a7e7ff1d5 is described below
commit 2a7e7ff1d5c2ccafc682cad79e275c72d411cc1f
Author: JingsongLi <ji...@gmail.com>
AuthorDate: Thu Nov 20 18:27:40 2025 +0800
[core] Expire after access 10 hours in RESTTokenFileIO
---
paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java b/paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java
index 469ce08d2b..d59ca6dd47 100644
--- a/paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java
+++ b/paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java
@@ -46,6 +46,7 @@ import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Map;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import static org.apache.paimon.options.CatalogOptions.FILE_IO_ALLOW_CACHE;
import static org.apache.paimon.rest.RESTApi.TOKEN_EXPIRATION_SAFE_TIME_MILLIS;
@@ -65,6 +66,7 @@ public class RESTTokenFileIO implements FileIO {
private static final Cache<RESTToken, FileIO> FILE_IO_CACHE =
Caffeine.newBuilder()
.maximumSize(1000)
+ .expireAfterAccess(10, TimeUnit.HOURS)
.removalListener(
(ignored, value, cause) -> IOUtils.closeQuietly((FileIO) value))
.scheduler(