You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by tu...@apache.org on 2011/12/08 21:10:41 UTC

svn commit: r1212080 - in /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/fs/GlobFilter.java

Author: tucu
Date: Thu Dec  8 20:10:41 2011
New Revision: 1212080

URL: http://svn.apache.org/viewvc?rev=1212080&view=rev
Log:
Merge -r 1186959:1186960 from trunk to branch. FIXES: HADOOP-7758

Modified:
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1212080&r1=1212079&r2=1212080&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt Thu Dec  8 20:10:41 2011
@@ -36,6 +36,8 @@ Release 0.23.1 - Unreleased
     HADOOP-6886. LocalFileSystem Needs createNonRecursive API.
     (Nicolas Spiegelberg and eli via eli)
 
+    HADOOP-7758. Make GlobFilter class public. (tucu)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java?rev=1212080&r1=1212079&r2=1212080&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java Thu Dec  8 20:10:41 2011
@@ -21,8 +21,15 @@ package org.apache.hadoop.fs;
 import java.util.regex.PatternSyntaxException;
 import java.io.IOException;
 
- // A class that could decide if a string matches the glob or not
-class GlobFilter implements PathFilter {
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+
+/**
+ * A filter for POSIX glob pattern with brace expansions.
+ */
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class GlobFilter implements PathFilter {
   private final static PathFilter DEFAULT_FILTER = new PathFilter() {
       public boolean accept(Path file) {
         return true;
@@ -32,11 +39,24 @@ class GlobFilter implements PathFilter {
   private PathFilter userFilter = DEFAULT_FILTER;
   private GlobPattern pattern;
 
-  GlobFilter(String filePattern) throws IOException {
+  /**
+   * Creates a glob filter with the specified file pattern.
+   *
+   * @param filePattern the file pattern.
+   * @throws IOException thrown if the file pattern is incorrect.
+   */
+  public GlobFilter(String filePattern) throws IOException {
     init(filePattern, DEFAULT_FILTER);
   }
 
-  GlobFilter(String filePattern, PathFilter filter) throws IOException {
+  /**
+   * Creates a glob filter with the specified file pattern and an user filter.
+   *
+   * @param filePattern the file pattern.
+   * @param filter user filter in addition to the glob pattern.
+   * @throws IOException thrown if the file pattern is incorrect.
+   */
+  public GlobFilter(String filePattern, PathFilter filter) throws IOException {
     init(filePattern, filter);
   }