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 to...@apache.org on 2012/07/17 00:42:07 UTC
svn commit: r1362297 - in
/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common:
CHANGES.txt src/main/java/org/apache/hadoop/fs/FileSystem.java
src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java
Author: todd
Date: Mon Jul 16 22:42:07 2012
New Revision: 1362297
URL: http://svn.apache.org/viewvc?rev=1362297&view=rev
Log:
HADOOP-8599. Non empty response from FileSystem.getFileBlockLocations when asking for data beyond the end of file. Contributed by Andrey Klochkov.
Modified:
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java
Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1362297&r1=1362296&r2=1362297&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt Mon Jul 16 22:42:07 2012
@@ -111,6 +111,9 @@ Release 0.23.3 - UNRELEASED
HADOOP-8587. HarFileSystem access of harMetaCache isn't threadsafe. (eli)
+ HADOOP-8599. Non empty response from FileSystem.getFileBlockLocations when
+ asking for data beyond the end of file. (Andrey Klochkov via todd)
+
Release 0.23.2 - UNRELEASED
NEW FEATURES
Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java?rev=1362297&r1=1362296&r2=1362297&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java Mon Jul 16 22:42:07 2012
@@ -564,7 +564,7 @@ public abstract class FileSystem extends
throw new IllegalArgumentException("Invalid start or len parameter");
}
- if (file.getLen() < start) {
+ if (file.getLen() <= start) {
return new BlockLocation[0];
}
Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java?rev=1362297&r1=1362296&r2=1362297&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGetFileBlockLocations.java Mon Jul 16 22:42:07 2012
@@ -122,6 +122,7 @@ public class TestGetFileBlockLocations e
oneTest(0, (int) status.getLen() * 2, status);
oneTest((int) status.getLen() * 2, (int) status.getLen() * 4, status);
oneTest((int) status.getLen() / 2, (int) status.getLen() * 3, status);
+ oneTest((int) status.getLen(), (int) status.getLen() * 2, status);
for (int i = 0; i < 10; ++i) {
oneTest((int) status.getLen() * i / 10, (int) status.getLen() * (i + 1)
/ 10, status);