diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index ce56e124bb0..06495bb7c66 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -867,6 +867,9 @@ Release 0.22.1 - Unreleased BUG FIXES + HADOOP-7937. Forward port SequenceFile#syncFs and friends from Hadoop 1.x. + (tomwhite) + Release 0.22.0 - 2011-11-29 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java index ce3030e660e..a64bd1bf9e2 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java @@ -1193,6 +1193,13 @@ public void sync() throws IOException { } } + /** flush all currently written data to the file system */ + public void syncFs() throws IOException { + if (out != null) { + out.sync(); // flush contents to file system + } + } + /** Returns the configuration of this file. */ Configuration getConf() { return conf; }