Browse Source

HADOOP-2828. The following deprecated methods in Configuration.java have been removed getObject(String name) setObject(String name, Object value) get(String name, Object defaultValue) set(String name, Object value) entries(). Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@640316 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 years ago
parent
commit
250b9c71e0

+ 10 - 0
CHANGES.txt

@@ -40,6 +40,16 @@ Trunk (unreleased changes)
     HADOOP-2116. Changes the layout of the task execution directory. 
     (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-2828. The following deprecated methods in Configuration.java
+    have been removed
+        getObject(String name)
+        setObject(String name, Object value)
+        get(String name, Object defaultValue)
+        set(String name, Object value)
+        Iterator entries()
+    (Amareshwari Sriramadasu via ddas)
+
+
   NEW FEATURES
 
     HADOOP-1398.  Add HBase in-memory block cache.  (tomwhite)

+ 1 - 1
src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java

@@ -254,7 +254,7 @@ public abstract class PipeMapRed {
     if (debug_) {
       logprintln("addJobConfToEnvironment: begin");
     }
-    Iterator it = conf.entries();
+    Iterator it = conf.iterator();
     while (it.hasNext()) {
       Map.Entry en = (Map.Entry) it.next();
       String name = (String) en.getKey();

+ 1 - 1
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java

@@ -869,7 +869,7 @@ public class StreamJob {
   protected void listJobConfProperties()
   {
     msg("==== JobConf properties:");
-    Iterator it = jobConf_.entries();
+    Iterator it = jobConf_.iterator();
     TreeMap sorted = new TreeMap();
     while(it.hasNext()) {
       Map.Entry en = (Map.Entry)it.next();

+ 0 - 44
src/java/org/apache/hadoop/conf/Configuration.java

@@ -227,33 +227,6 @@ public class Configuration implements Iterable<Map.Entry<String,String>> {
     finalParameters.clear();                      // clear site-limits
   }
   
-  /**
-   * Returns the value of the <code>name</code> property, or null if no such
-   * property exists.
-   * @deprecated A side map of Configuration to Object should be used instead.
-   */
-  @Deprecated
-  public Object getObject(String name) { return getProps().get(name);}
-
-  /** Sets the value of the <code>name</code> property. 
-   * @deprecated
-   */
-  @Deprecated
-  public void setObject(String name, Object value) {
-    getProps().put(name, value);
-  }
-
-  /** Returns the value of the <code>name</code> property.  If no such property
-   * exists, then <code>defaultValue</code> is returned.
-   * @deprecated A side map of Configuration to Object should be used instead.
-   */
-  @Deprecated
-  public Object get(String name, Object defaultValue) {
-    Object res = getObject(name);
-    if (res != null) return res;
-    else return defaultValue;
-  }
-  
   private static Pattern varPat = Pattern.compile("\\$\\{[^\\}\\$\u0020]+\\}");
   private static int MAX_SUBST = 20;
 
@@ -311,15 +284,6 @@ public class Configuration implements Iterable<Map.Entry<String,String>> {
     return getProps().getProperty(name);
   }
 
-  /** Sets the value of the <code>name</code> property. 
-   * @deprecated
-   */
-  @Deprecated
-  public void set(String name, Object value) {
-    getOverlay().setProperty(name, value.toString());
-    getProps().setProperty(name, value.toString());
-  }
-  
   /** 
    * Set the <code>value</code> of the <code>name</code> property.
    * 
@@ -782,14 +746,6 @@ public class Configuration implements Iterable<Map.Entry<String,String>> {
     return properties;
   }
 
-  /** @return Iterator&lt; Map.Entry&lt;String,String> >  
-   * @deprecated Use {@link #iterator()} instead. 
-   */
-  @Deprecated
-  public Iterator entries() {
-    return iterator();
-  }
-
   /**
    * Get an {@link Iterator} to go through the list of <code>String</code> 
    * key-value pairs in the configuration.

+ 1 - 1
src/test/org/apache/hadoop/dfs/TestTrash.java

@@ -68,7 +68,7 @@ public class TestTrash extends TestCase {
    */
   public void testTrash() throws IOException {
     Configuration conf = new Configuration();
-    conf.set("fs.trash.interval", 10); // 10 minute
+    conf.set("fs.trash.interval", "10"); // 10 minute
     MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
     FileSystem fs = cluster.getFileSystem();
     DistributedFileSystem fileSys = (DistributedFileSystem) fs;