wu-sheng commented on code in PR #10544:
URL: https://github.com/apache/skywalking/pull/10544#discussion_r1139936541


##########
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/TableHelper.java:
##########
@@ -54,6 +58,16 @@ public class TableHelper {
     @Getter(lazy = true, value = AccessLevel.PRIVATE)
     private final ConfigService configService = 
moduleManager.find(CoreModule.NAME).provider().getService(ConfigService.class);
 
+    private final LoadingCache<String, Boolean> tableExistence =
+        CacheBuilder.newBuilder()
+                    .expireAfterWrite(10, TimeUnit.MINUTES)
+                    .build(new CacheLoader<>() {
+                        @Override
+                        public @NonNull Boolean load(@NonNull String 
tableName) throws Exception {
+                            return jdbcClient.tableExists(tableName);
+                        }
+                    });

Review Comment:
   Make sense for `manually remove`.
   
   Meanwhile, considering at the beginning, only the current date index is 
created, then N - 7  will be always absent, right? Should we maybe put an 
Optional<TableStatus> in the cache in case of always doing metadata queries?
   



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