Browse Source

HADOOP-1010. Add Reporter.NULL. Contributed by Runping.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@506750 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
fab23704be
2 changed files with 20 additions and 3 deletions
  1. 3 0
      CHANGES.txt
  2. 17 3
      src/java/org/apache/hadoop/mapred/Reporter.java

+ 3 - 0
CHANGES.txt

@@ -39,6 +39,9 @@ Trunk (unreleased changes)
     value of zero mean no timeout.  Also change contrib/streaming to
     disable task timeouts.  (Arun C Murthy via cutting)
 
+12. HADOOP-1010.  Add Reporter.NULL, a Reporter implementation that
+    does nothing.  (Runping Qi via cutting)
+
 
 Release 0.11.1 - 2007-02-09
 

+ 17 - 3
src/java/org/apache/hadoop/mapred/Reporter.java

@@ -23,9 +23,23 @@ import org.apache.hadoop.util.Progressable;
 
 /** Passed to application code to permit alteration of status. */
 public interface Reporter extends Progressable {
-  /** Alter the application's status description.
-   *
-   * @param status a brief description of the current status
+  
+  /**
+   * A constant of Reporter type that does nothing.
+   */
+  public static final Reporter NULL = new Reporter() {
+    public void setStatus(String s) {
+    }
+
+    public void progress() throws IOException {
+    }
+  };
+
+  /**
+   * Alter the application's status description.
+   * 
+   * @param status
+   *          a brief description of the current status
    */
   void setStatus(String status) throws IOException;
 }