1
0
فهرست منبع

HADOOP-2754 Filter out .crc files from local file system listing. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@618416 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 17 سال پیش
والد
کامیت
13049d463e
2فایلهای تغییر یافته به همراه23 افزوده شده و 5 حذف شده
  1. 3 0
      CHANGES.txt
  2. 20 5
      src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

+ 3 - 0
CHANGES.txt

@@ -16,6 +16,9 @@ Trunk (unreleased changes)
     HADOOP-2738 Text is not subclassable because set(Text) and compareTo(Object)
     access the other instance's private members directly.
 
+    HADOOP-2754 Filter out .crc files from local file system listing.
+    (Hairong Kuang via shv)
+
 Release 0.16.0 - 2008-02-07
 
   INCOMPATIBLE CHANGES

+ 20 - 5
src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

@@ -425,18 +425,32 @@ public abstract class ChecksumFileSystem extends FilterFileSystem {
   }
 
   final private static PathFilter DEFAULT_FILTER = new PathFilter() {
-      public boolean accept(Path file) {
-        return !isChecksumFile(file);
-      }
-    };
+    public boolean accept(Path file) {
+      return !isChecksumFile(file);
+    }
+  };
 
+  /**
+   * List the statuses of the files/directories in the given path if the path is
+   * a directory.
+   * 
+   * @param f
+   *          given path
+   * @return the statuses of the files/directories in the given patch
+   * @throws IOException
+   */
+  @Override
+  public FileStatus[] listStatus(Path f) throws IOException {
+    return fs.listStatus(f, DEFAULT_FILTER);
+  }
+  
   /** 
    * Filter raw files in the given pathes using the default checksum filter. 
    * @param files a list of paths
    * @return a list of files under the source paths
    * @exception IOException
    */
-  @Override
+  @Deprecated
   public Path[] listPaths(Path[] files) throws IOException {
     return fs.listPaths(files, DEFAULT_FILTER);
   }
@@ -447,6 +461,7 @@ public abstract class ChecksumFileSystem extends FilterFileSystem {
    * @return a list of files under the source path
    * @exception IOException
    */
+  @Deprecated
   public Path[] listPaths(Path f) throws IOException {
     return fs.listPaths(f, DEFAULT_FILTER);
   }