yuxiqian commented on code in PR #3994:
URL: https://github.com/apache/flink-cdc/pull/3994#discussion_r2078949621


##########
flink-cdc-common/src/main/java/org/apache/flink/cdc/common/schema/Selectors.java:
##########
@@ -71,8 +83,20 @@ public boolean isMatch(TableId tableId) {
         }
     }
 
-    /** Match the {@link TableId} against the {@link Selector}s. * */
+    /** Match the {@link TableId} against the {@link Selector}s. */
     public boolean isMatch(TableId tableId) {
+        Boolean cachedResult = cache.getIfPresent(tableId);
+        if (cachedResult != null) {
+            return cachedResult;
+        }
+
+        boolean match = computeIsMatch(tableId);
+        cache.put(tableId, match);
+        return match;

Review Comment:
   This could be simplified with `LoadingCache`:
   
   ```suggestion
           return cache.getUnchecked(tableId);
   ```



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to