Переглянути джерело

HADOOP-2078. An zero size file may have no blocks associated with it.
(Konstantin Shvachko via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@595563 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 18 роки тому
батько
коміт
25210966a4
2 змінених файлів з 5 додано та 5 видалено
  1. 3 0
      CHANGES.txt
  2. 2 5
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -104,6 +104,9 @@ Trunk (unreleased changes)
     to get created, thus causing unit test failure.
     (Raghu Angadi via dhruba)
 
+    HADOOP-2078. An zero size file may have no blocks associated with it.
+    (Konstantin Shvachko via dhruba)
+
 Release 0.15.1 -
 
   IMPROVEMENTS

+ 2 - 5
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -1076,13 +1076,10 @@ class FSNamesystem implements FSConstants {
       pendingFile = (INodeFileUnderConstruction) iFile;
       fileBlocks =  dir.getFileBlocks(src);
     }
-    if (fileBlocks == null || fileBlocks.length == 0 ||
-        pendingFile == null) {    
+    if (fileBlocks == null ) {    
       NameNode.stateChangeLog.warn("DIR* NameSystem.completeFile: "
                                    + "failed to complete " + src
-                                   + " because dir.getFileBlocks() is " + 
-                                   ((fileBlocks == null) ? 
-                                    "null":fileBlocks.length) + 
+                                   + " because dir.getFileBlocks() is null " + 
                                    " and pendingFile is " + 
                                    ((pendingFile == null) ? "null" : 
                                      ("from " + pendingFile.getClientMachine()))