hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1364801 - in /hadoop/common/branches/branch-1: CHANGES.txt src/core/org/apache/hadoop/fs/FileSystem.java src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java
Date Mon, 23 Jul 2012 21:18:51 GMT
Author: eli
Date: Mon Jul 23 21:18:51 2012
New Revision: 1364801

URL: http://svn.apache.org/viewvc?rev=1364801&view=rev
Log:
HADOOP-8612. Backport HADOOP-8599 to branch-1 (Non empty response when read beyond eof). Contributed
by Andrey Klochkov

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/core/org/apache/hadoop/fs/FileSystem.java
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1364801&r1=1364800&r2=1364801&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Jul 23 21:18:51 2012
@@ -99,6 +99,9 @@ Release 1.2.0 - unreleased
     HDFS-3698. TestHftpFileSystem is failing in branch-1 due to changed
     default secure port. (atm)
 
+    HADOOP-8612. Backport HADOOP-8599 to branch-1 (Non empty response
+    when read beyond eof). (Andrey Klochkov, eli via eli)
+
 Release 1.1.0 - unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/core/org/apache/hadoop/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/core/org/apache/hadoop/fs/FileSystem.java?rev=1364801&r1=1364800&r2=1364801&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/core/org/apache/hadoop/fs/FileSystem.java (original)
+++ hadoop/common/branches/branch-1/src/core/org/apache/hadoop/fs/FileSystem.java Mon Jul
23 21:18:51 2012
@@ -402,7 +402,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-1/src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java?rev=1364801&r1=1364800&r2=1364801&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/fs/TestGetFileBlockLocations.java
Mon Jul 23 21:18:51 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);



Mime
View raw message