colinmjj commented on code in PR #53:
URL: https://github.com/apache/incubator-uniffle/pull/53#discussion_r949995218


##########
storage/src/main/java/org/apache/uniffle/storage/handler/impl/HdfsFileWriter.java:
##########
@@ -39,35 +39,37 @@ public class HdfsFileWriter implements Closeable {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(HdfsFileWriter.class);
 
+  private final FileSystem fileSystem;
+
   private Path path;
   private Configuration hadoopConf;
   private FSDataOutputStream fsDataOutputStream;
   private long nextOffset;
 
-  public HdfsFileWriter(Path path, Configuration hadoopConf) throws 
IOException, IllegalStateException {
-    // init fsDataOutputStream
+  public HdfsFileWriter(FileSystem fileSystem, Path path, Configuration 
hadoopConf) throws IOException {
     this.path = path;
     this.hadoopConf = hadoopConf;
+    this.fileSystem = fileSystem;
     initStream();
   }
 
   private void initStream() throws IOException, IllegalStateException {
-    FileSystem fileSystem = ShuffleStorageUtils.getFileSystemForPath(path, 
hadoopConf);
-    if (fileSystem.isFile(path)) {
+    final FileSystem writerFs = fileSystem;
+    if (writerFs.isFile(path)) {
       if (hadoopConf.getBoolean("dfs.support.append", true)) {
-        fsDataOutputStream = fileSystem.append(path);
+        fsDataOutputStream = writerFs.append(path);

Review Comment:
   ok



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to