Browse Source

Merge -r 1228290:1228291 from trunk to branch-0.22. Fixes: HADOOP-7937

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1228295 13f79535-47bb-0310-9956-ffa450edef68
Thomas White 13 years ago
parent
commit
e35a8824ff
2 changed files with 11 additions and 0 deletions
  1. 4 0
      common/CHANGES.txt
  2. 7 0
      common/src/java/org/apache/hadoop/io/SequenceFile.java

+ 4 - 0
common/CHANGES.txt

@@ -12,6 +12,10 @@ Release 0.22.1 - Unreleased
 
 
   BUG FIXES
   BUG FIXES
 
 
+    HADOOP-7937. Forward port SequenceFile#syncFs and friends from Hadoop 1.x.
+    (tomwhite)
+
+
 Release 0.22.0 - 2011-11-29
 Release 0.22.0 - 2011-11-29
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 7 - 0
common/src/java/org/apache/hadoop/io/SequenceFile.java

@@ -1128,6 +1128,13 @@ public class SequenceFile {
       }
       }
     }
     }
 
 
+    /** 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. */
     /** Returns the configuration of this file. */
     Configuration getConf() { return conf; }
     Configuration getConf() { return conf; }