StephanEwen commented on a change in pull request #13394:
URL: https://github.com/apache/flink/pull/13394#discussion_r488764947



##########
File path: 
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileStatus.java
##########
@@ -77,4 +77,17 @@ public boolean isDir() {
        public org.apache.hadoop.fs.FileStatus getInternalFileStatus() {
                return this.fileStatus;
        }
+
+       // 
------------------------------------------------------------------------
+
+       /**
+        * Creates a new {@code HadoopFileStatus} from Hadoop's {@link 
org.apache.hadoop.fs.FileStatus}.
+        * If Hadoop's file status is <i>located</i>, i.e., it contains block 
information, then this method
+        * returns an implementation of Flink's {@link 
org.apache.flink.core.fs.LocatedFileStatus}.
+        */
+       public static HadoopFileStatus fromHadoopStatus(final 
org.apache.hadoop.fs.FileStatus fileStatus) {

Review comment:
       The idea here was that the class itself needs not know its subclasses, 
but we need a factory that is aware of that.
   I put the factory in that class, we could also put it into 
`HadoopFileSystem`. But I thought having it more visible would actually be a 
good idea here.




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


Reply via email to