PatrickRen commented on code in PR #20489:
URL: https://github.com/apache/flink/pull/20489#discussion_r940927210


##########
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java:
##########
@@ -181,6 +179,27 @@ private JdbcDmlOptions getJdbcDmlOptions(
                 .build();
     }
 
+    @Nullable
+    private LookupCache getLookupCache(ReadableConfig tableOptions) {
+        LookupCache cache = null;
+        // Legacy cache options
+        if (tableOptions.get(LOOKUP_CACHE_MAX_ROWS) > 0
+                && tableOptions.get(LOOKUP_CACHE_TTL).compareTo(Duration.ZERO) 
> 0) {
+            cache =
+                    DefaultLookupCache.newBuilder()
+                            
.maximumSize(tableOptions.get(LOOKUP_CACHE_MAX_ROWS))
+                            
.expireAfterWrite(tableOptions.get(LOOKUP_CACHE_TTL))
+                            
.cacheMissingKey(tableOptions.get(LOOKUP_CACHE_MISSING_KEY))
+                            .build();
+        }

Review Comment:
   Actually old keys are not fully compatible with new options considering we 
introduces LookupOptions#CACHE_TYPE and maybe full caching in the future. I'll 
keep the current logic here for now. 



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