Author: rangadi
Date: Thu May 22 21:02:31 2008
New Revision: 659405
URL: http://svn.apache.org/viewvc?rev=659405&view=rev
Log:
HADOOP-3265. Removed depcrecated API getFileCacheHints().
(Lohit Vijayarenu via rangadi)
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileSystem.java
hadoop/core/trunk/src/test/org/apache/hadoop/dfs/TestFileAppend.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=659405&r1=659404&r2=659405&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu May 22 21:02:31 2008
@@ -58,6 +58,9 @@
MapTaskStatus, ReduceTaskStatus, JobSubmissionProtocol,
CompletedJobStatusStore. (enis via omaley)
+ HADOOP-3265. Removed depcrecated API getFileCacheHints().
+ (Lohit Vijayarenu via rangadi)
+
NEW FEATURES
HADOOP-3074. Provides a UrlStreamHandler for DFS and other FS,
Modified: hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileSystem.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileSystem.java?rev=659405&r1=659404&r2=659405&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileSystem.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/fs/FileSystem.java Thu May 22
21:02:31 2008
@@ -318,35 +318,6 @@
}
/**
- * @deprecated Use getFileBlockLocations() instead
- *
- * Return a 2D array of size 1x1 or greater, containing hostnames
- * where portions of the given file can be found. For a nonexistent
- * file or regions, null will be returned.
- *
- * This call is most helpful with DFS, where it returns
- * hostnames of machines that contain the given file.
- *
- * The FileSystem will simply return an elt containing 'localhost'.
- */
- @Deprecated
- public String[][] getFileCacheHints(Path f, long start, long len)
- throws IOException {
- BlockLocation[] blkLocations = getFileBlockLocations(f, start, len);
- if ((blkLocations == null) || (blkLocations.length == 0)) {
- return new String[0][];
- }
- int blkCount = blkLocations.length;
- String[][] hints = new String[blkCount][];
- for (int i=0; i < blkCount; i++) {
- String[] hosts = blkLocations[i].getHosts();
- hints[i] = new String[hosts.length];
- hints[i] = hosts;
- }
- return hints;
- }
-
- /**
* Return an array containing hostnames, offset and size of
* portions of the given file. For a nonexistent
* file or regions, null will be returned.
Modified: hadoop/core/trunk/src/test/org/apache/hadoop/dfs/TestFileAppend.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/dfs/TestFileAppend.java?rev=659405&r1=659404&r2=659405&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/dfs/TestFileAppend.java
(original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/dfs/TestFileAppend.java Thu
May 22 21:02:31 2008
@@ -29,6 +29,7 @@
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileUtil.HardLink;
+import org.apache.hadoop.fs.BlockLocation;
/**
* This class tests the building blocks that are needed to
@@ -91,14 +92,15 @@
Thread.sleep(1000);
} catch (InterruptedException e) {}
done = true;
- String[][] locations = fileSys.getFileCacheHints(name, 0, fileSize);
+ BlockLocation[] locations = fileSys.getFileBlockLocations(name, 0,
+ fileSize);
if (locations.length < numBlocks) {
System.out.println("Number of blocks found " + locations.length);
done = false;
continue;
}
for (int idx = 0; idx < numBlocks; idx++) {
- if (locations[idx].length < repl) {
+ if (locations[idx].getHosts().length < repl) {
System.out.println("Block index " + idx + " not yet replciated.");
done = false;
break;