Skip to content

Commit

Permalink
HDFS-15882. Fix incorrectly initializing RandomAccessFile based on co…
Browse files Browse the repository at this point in the history
…nfiguration options (apache#2751). Contributed by Xie Lei.

Reviewed-by: He Xiaoqiao <[email protected]>
  • Loading branch information
lamberken authored and Kiran Kumar Maturi committed Nov 24, 2021
1 parent 44df69e commit b5ffc0d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public EditLogFileOutputStream(Configuration conf, File name, int size)
doubleBuf = new EditsDoubleBuffer(size);
RandomAccessFile rp;
if (shouldSyncWritesAndSkipFsync) {
rp = new RandomAccessFile(name, "rws");
} else {
rp = new RandomAccessFile(name, "rw");
} else {
rp = new RandomAccessFile(name, "rws");
}
fp = new FileOutputStream(rp.getFD()); // open for append
fc = rp.getChannel();
Expand Down

0 comments on commit b5ffc0d

Please sign in to comment.