Zakelly commented on code in PR #25561:
URL: https://github.com/apache/flink/pull/25561#discussion_r1827608953


##########
flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFlinkFileSystem.java:
##########
@@ -75,7 +111,22 @@ public ForStFlinkFileSystem(FileSystem delegateFS, String 
remoteBase, String loc
     public static FileSystem get(URI uri) throws IOException {
         String localBase = remoteLocalMapping.get(uri.toString());
         Preconditions.checkNotNull(localBase, "localBase is null, remote uri:" 
+ uri);
-        return new ForStFlinkFileSystem(FileSystem.get(uri), uri.toString(), 
localBase);
+        return new ForStFlinkFileSystem(
+                FileSystem.get(uri),
+                uri.toString(),
+                localBase,
+                cacheBase == null
+                        ? null
+                        : new FileBasedCache(
+                                Integer.MAX_VALUE,
+                                new BundledCacheLimitPolicy(
+                                        new SystemCacheLimitPolicy(
+                                                new File(localBase),
+                                                cacheReservedSize,
+                                                SST_FILE_SIZE),
+                                        new 
FixedCapCacheLimitPolicy(cacheCapacity)),

Review Comment:
   I'd suggest not building specific policy when it is disabled. Also the 
`SystemCacheLimitPolicy` and `FixedCapCacheLimitPolicy` is not that intuitive, 
WDYT?



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