JingsongLi commented on code in PR #4648:
URL: https://github.com/apache/paimon/pull/4648#discussion_r1875700063


##########
paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java:
##########
@@ -27,37 +26,42 @@
 import org.apache.paimon.manifest.PartitionEntry;
 import org.apache.paimon.options.CatalogOptions;
 import org.apache.paimon.options.Options;
+import org.apache.paimon.rest.auth.AuthSession;
+import org.apache.paimon.rest.auth.CredentialsProvider;
+import org.apache.paimon.rest.auth.CredentialsProviderFactory;
 import org.apache.paimon.rest.responses.ConfigResponse;
 import org.apache.paimon.schema.Schema;
 import org.apache.paimon.schema.SchemaChange;
 import org.apache.paimon.table.Table;
 
-import org.apache.paimon.shade.guava30.com.google.common.collect.ImmutableMap;
+import 
org.apache.paimon.shade.guava30.com.google.common.annotations.VisibleForTesting;
 import 
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.time.Duration;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.ScheduledExecutorService;
+
+import static 
org.apache.paimon.utils.ThreadPoolUtils.createScheduledThreadPool;
 
 /** A catalog implementation for REST. */
 public class RESTCatalog implements Catalog {
     private RESTClient client;
-    private String token;
     private ResourcePaths resourcePaths;
     private Map<String, String> options;
     private Map<String, String> baseHeader;
+    // a lazy thread pool for token refresh
+    private final AuthSession catalogAuth;
+    private volatile ScheduledExecutorService refreshExecutor = null;

Review Comment:
   close this in catalog.close?



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