yangjiandan commented on code in PR #25226:
URL: https://github.com/apache/flink/pull/25226#discussion_r1724526749
##########
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopRecoverableFsDataOutputStream.java:
##########
@@ -57,14 +60,31 @@ class HadoopRecoverableFsDataOutputStream extends
BaseHadoopFsRecoverableFsDataO
private static Method truncateHandle;
- HadoopRecoverableFsDataOutputStream(FileSystem fs, Path targetFile, Path
tempFile)
+ HadoopRecoverableFsDataOutputStream(
+ FileSystem fs, Path targetFile, Path tempFile, boolean
noLocalWrite)
throws IOException {
ensureTruncateInitialized();
this.fs = checkNotNull(fs);
this.targetFile = checkNotNull(targetFile);
this.tempFile = checkNotNull(tempFile);
+ if (noLocalWrite) {
+ this.out =
+ fs.create(
+ tempFile,
+ FsPermission.getFileDefault(),
+ EnumSet.of(
+ CreateFlag.CREATE,
+ CreateFlag.OVERWRITE,
+ CreateFlag.NO_LOCAL_WRITE),
+ fs.getConf().getInt("io.file.buffer.size", 4096),
+ fs.getDefaultReplication(tempFile),
+ fs.getDefaultBlockSize(tempFile),
+ null);
+ } else {
+ this.out = fs.create(tempFile);
+ }
this.out = fs.create(tempFile);
Review Comment:
remove this
##########
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopRecoverableFsDataOutputStream.java:
##########
@@ -57,14 +60,31 @@ class HadoopRecoverableFsDataOutputStream extends
BaseHadoopFsRecoverableFsDataO
private static Method truncateHandle;
- HadoopRecoverableFsDataOutputStream(FileSystem fs, Path targetFile, Path
tempFile)
+ HadoopRecoverableFsDataOutputStream(
+ FileSystem fs, Path targetFile, Path tempFile, boolean
noLocalWrite)
throws IOException {
ensureTruncateInitialized();
this.fs = checkNotNull(fs);
this.targetFile = checkNotNull(targetFile);
this.tempFile = checkNotNull(tempFile);
+ if (noLocalWrite) {
+ this.out =
+ fs.create(
+ tempFile,
+ FsPermission.getFileDefault(),
+ EnumSet.of(
+ CreateFlag.CREATE,
+ CreateFlag.OVERWRITE,
+ CreateFlag.NO_LOCAL_WRITE),
+ fs.getConf().getInt("io.file.buffer.size", 4096),
+ fs.getDefaultReplication(tempFile),
+ fs.getDefaultBlockSize(tempFile),
+ null);
+ } else {
+ this.out = fs.create(tempFile);
+ }
this.out = fs.create(tempFile);
Review Comment:
remove this
--
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]