Bläddra i källkod

HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple
blocks correctly. Contributed by Sriram Rao.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19@720461 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 16 år sedan
förälder
incheckning
ab9e480a5c
2 ändrade filer med 10 tillägg och 1 borttagningar
  1. 7 0
      CHANGES.txt
  2. 3 1
      src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

+ 7 - 0
CHANGES.txt

@@ -1,5 +1,12 @@
 Hadoop Change Log
 
+Release 0.19.1 - Unreleased
+
+  BUG FIXES
+
+    HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple
+    blocks correctly. (Sriram Rao via cdouglas)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

+ 3 - 1
src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

@@ -294,9 +294,11 @@ public class KosmosFileSystem extends FileSystem {
       BlockLocation[] result = new BlockLocation[hints.length];
       long blockSize = getDefaultBlockSize();
       long length = len;
+      long blockStart = start;
       for(int i=0; i < result.length; ++i) {
-        result[i] = new BlockLocation(null, hints[i], start, 
+        result[i] = new BlockLocation(null, hints[i], blockStart, 
                                       length < blockSize ? length : blockSize);
+        blockStart += blockSize;
         length -= blockSize;
       }
       return result;