zentol commented on a change in pull request #11095: 
[FLINK-10918][rocks-db-backend] Fix incremental checkpoints on Windows.
URL: https://github.com/apache/flink/pull/11095#discussion_r379417283
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/SnapshotDirectory.java
 ##########
 @@ -49,50 +49,37 @@
        @Nonnull
        protected final Path directory;
 
-       /** The filesystem that contains the snapshot directory. */
-       @Nonnull
-       protected final FileSystem fileSystem;
-
        /** This reference tracks the lifecycle state of the snapshot 
directory. */
        @Nonnull
        protected AtomicReference<State> state;
 
-       private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem 
fileSystem) {
+       private SnapshotDirectory(@Nonnull Path directory) {
                this.directory = directory;
-               this.fileSystem = fileSystem;
                this.state = new AtomicReference<>(State.ONGOING);
        }
 
-       private SnapshotDirectory(@Nonnull Path directory) throws IOException {
-               this(directory, directory.getFileSystem());
-       }
-
        @Nonnull
        public Path getDirectory() {
                return directory;
        }
 
        public boolean mkdirs() throws IOException {
-               return fileSystem.mkdirs(directory);
-       }
-
-       @Nonnull
-       public FileSystem getFileSystem() {
-               return fileSystem;
+               Files.createDirectories(directory);
+               return true;
        }
 
        public boolean exists() throws IOException {
-               return fileSystem.exists(directory);
+               return Files.exists(directory);
        }
 
        /**
-        * List the statuses of the files/directories in the snapshot directory.
+        * List the files in the snapshot directory.
         *
-        * @return the statuses of the files/directories in the given path.
+        * @return the files in the snapshot directory.
         * @throws IOException if there is a problem creating the file statuses.
         */
-       public FileStatus[] listStatus() throws IOException {
-               return fileSystem.listStatus(directory);
+       public Path[] listDirectory() throws IOException {
+               return Files.list(directory).toArray(Path[]::new);
 
 Review comment:
   IIRC the `Stream<Path>` returned by `Files.list` must be explicitly closed.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to