소스 검색

HADOOP-3861. MapFile.Reader and Writer should implement Closeable.
Contributed by Tom White.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@681217 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 17 년 전
부모
커밋
ff8e0bc289
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      CHANGES.txt
  2. 2 2
      src/core/org/apache/hadoop/io/MapFile.java

+ 3 - 0
CHANGES.txt

@@ -121,6 +121,9 @@ Trunk (unreleased changes)
     HADOOP-3646. Add a bzip2 compatible codec, so bzip compressed data
     may be processed by map/reduce. (Abdul Qadeer via cdouglas)
 
+    HADOOP-3861. MapFile.Reader and Writer should implement Closeable.
+    (tomwhite via omalley)
+
   OPTIMIZATIONS
 
     HADOOP-3556. Removed lock contention in MD5Hash by changing the 

+ 2 - 2
src/core/org/apache/hadoop/io/MapFile.java

@@ -58,7 +58,7 @@ public class MapFile {
   protected MapFile() {}                          // no public ctor
 
   /** Writes a new map. */
-  public static class Writer {
+  public static class Writer implements java.io.Closeable {
     private SequenceFile.Writer data;
     private SequenceFile.Writer index;
 
@@ -215,7 +215,7 @@ public class MapFile {
   }
   
   /** Provide access to an existing map. */
-  public static class Reader {
+  public static class Reader implements java.io.Closeable {
       
     /** Number of index entries to skip between each entry.  Zero by default.
      * Setting this to values larger than zero can facilitate opening large map