fredia commented on code in PR #26253:
URL: https://github.com/apache/flink/pull/26253#discussion_r1981501160


##########
flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFlinkFileSystem.java:
##########
@@ -126,22 +126,35 @@ public static FileBasedCache getFileBasedCache(
                             + "since the cache and primary path are on the 
same file system.");
             return null;
         }
+        // Create cache directory to make SpaceBasedCacheLimitPolicy works.
+        if (!cacheBase.getFileSystem().mkdirs(cacheBase)) {
+            throw new IOException(
+                    String.format("Could not create ForSt cache directory at 
%s.", cacheBase));
+        }
         CacheLimitPolicy cacheLimitPolicy = null;
         long targetSstFileSize = config.get(TARGET_FILE_SIZE_BASE).getBytes();
-        if (cacheCapacity > 0 && cacheReservedSize >= 0) {
+        boolean useSizeBasedCache = cacheCapacity > 0;
+        // We may encounter the case that the SpaceBasedCacheLimitPolicy 
cannot work properly on
+        // the file system, so we need to check if it works.
+        boolean useSpaceBasedCache =

Review Comment:
   How about updating the description in ConfigOption accordingly?



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