Browse Source

HADOOP-2825. Deprecated MapOutputLocation.getFile() is removed. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@637727 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 years ago
parent
commit
9a30df9158
2 changed files with 4 additions and 72 deletions
  1. 4 0
      CHANGES.txt
  2. 0 72
      src/java/org/apache/hadoop/mapred/MapOutputLocation.java

+ 4 - 0
CHANGES.txt

@@ -241,6 +241,10 @@ Trunk (unreleased changes)
     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

+ 0 - 72
src/java/org/apache/hadoop/mapred/MapOutputLocation.java

@@ -98,78 +98,6 @@ class MapOutputLocation implements Writable, MRConstants {
       mapTaskId;
   }
   
-  /**
-   * 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.