carp84 commented on a change in pull request #7942: [FLINK-11696][checkpoint] 
Avoid to send mkdir requests to DFS from task side
URL: https://github.com/apache/flink/pull/7942#discussion_r264202317
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStorageTest.java
 ##########
 @@ -190,18 +190,27 @@ public void testDirectoriesForExclusiveAndSharedState() 
throws Exception {
        }
 
        /**
-        * This test checks that no mkdirs is called by the checkpoint storage 
location when resolved.
+        * This test checks that the expected mkdirs action for checkpoint 
storage,
+        * only called when initializeLocationForCheckpoint and not called when 
resolveCheckpointStorageLocation.
         */
        @Test
-       public void testStorageLocationDoesNotMkdirs() throws Exception {
+       public void testStorageLocationMkdirs() throws Exception {
+               // mkdirs only called when initializeLocationForCheckpoint
                FsCheckpointStorage storage = new FsCheckpointStorage(
-                               randomTempPath(), null, new JobID(), 
FILE_SIZE_THRESHOLD);
+                       randomTempPath(), null, new JobID(), 
FILE_SIZE_THRESHOLD);
 
-               File baseDir =  new 
File(storage.getCheckpointsDirectory().getPath());
+               File baseDir = new 
File(storage.getCheckpointsDirectory().getPath());
+               assertFalse(baseDir.exists());
+
+               storage.initializeLocationForCheckpoint(177L);
                assertTrue(baseDir.exists());
 
+               // mkdir would not be called when 
resolveCheckpointStorageLocation
+               storage = new FsCheckpointStorage(
+                       randomTempPath(), null, new JobID(), 
FILE_SIZE_THRESHOLD);
+
                FsCheckpointStorageLocation location = 
(FsCheckpointStorageLocation)
-                               storage.resolveCheckpointStorageLocation(177, 
CheckpointStorageLocationReference.getDefault());
+                       storage.resolveCheckpointStorageLocation(177L, 
CheckpointStorageLocationReference.getDefault());
 
 Review comment:
   This change seems unnecessary.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to