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 dd...@apache.org on 2008/03/17 06:36:07 UTC

svn commit: r637727 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/MapOutputLocation.java

Author: ddas
Date: Sun Mar 16 22:36:06 2008
New Revision: 637727

URL: http://svn.apache.org/viewvc?rev=637727&view=rev
Log:
HADOOP-2825. Deprecated MapOutputLocation.getFile() is removed. Contributed by Amareshwari Sriramadasu.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapOutputLocation.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=637727&r1=637726&r2=637727&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Sun Mar 16 22:36:06 2008
@@ -241,6 +241,10 @@
     with different sizes to the namenode, the namenode picks the
     replica(s) with the largest size as the only valid replica(s). (dhruba)
 
+    HADOOP-2825. Deprecated MapOutputLocation.getFile() is removed.
+    (Amareshwari Sri Ramadasu via ddas)
+
+
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapOutputLocation.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapOutputLocation.java?rev=637727&r1=637726&r2=637727&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapOutputLocation.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapOutputLocation.java Sun Mar 16 22:36:06 2008
@@ -99,78 +99,6 @@
   }
   
   /**
-   * Get the map output into a local file from the remote server.
-   * We use the file system so that we generate checksum files on the data.
-   * @param fileSys the filesystem to write the file to
-   * @param localFilename the filename to write the data into
-   * @param reduce the reduce id to get for
-   * @param pingee a status object that wants to know when we make progress
-   * @param timeout number of ms for connection and read timeout
-   * @throws IOException when something goes wrong
-   * @deprecated
-   */
-  @Deprecated
-  public long getFile(FileSystem fileSys, 
-                      Path localFilename, 
-                      int reduce,
-                      Progressable pingee,
-                      int timeout) throws IOException, InterruptedException {
-    boolean good = false;
-    long totalBytes = 0;
-    Thread currentThread = Thread.currentThread();
-    URL path = new URL(toString() + "&reduce=" + reduce);
-    try {
-      URLConnection connection = path.openConnection();
-      if (timeout > 0) {
-        connection.setConnectTimeout(timeout);
-        connection.setReadTimeout(timeout);
-      }
-      InputStream input = connection.getInputStream();
-      try {
-        OutputStream output = fileSys.create(localFilename);
-        try {
-          byte[] buffer = new byte[64 * 1024];
-          if (currentThread.isInterrupted()) {
-            throw new InterruptedException();
-          }
-          int len = input.read(buffer);
-          while (len > 0) {
-            totalBytes += len;
-            output.write(buffer, 0 , len);
-            if (pingee != null) {
-              pingee.progress();
-            }
-            if (currentThread.isInterrupted()) {
-              throw new InterruptedException();
-            }
-            len = input.read(buffer);
-          }
-        } finally {
-          output.close();
-        }
-      } finally {
-        input.close();
-      }
-      good = ((int) totalBytes) == connection.getContentLength();
-      if (!good) {
-        throw new IOException("Incomplete map output received for " + path +
-                              " (" + totalBytes + " instead of " + 
-                              connection.getContentLength() + ")");
-      }
-    } finally {
-      if (!good) {
-        try {
-          fileSys.delete(localFilename, true);
-          totalBytes = 0;
-        } catch (Throwable th) {
-          // IGNORED because we are cleaning up
-        }
-      }
-    }
-    return totalBytes;
-  }
-  
-  /**
    * Get the map output into a local file (either in the inmemory fs or on the 
    * local fs) from the remote server.
    * We use the file system so that we generate checksum files on the data.