hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r793747 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
Date Mon, 13 Jul 2009 23:28:06 GMT
Author: shv
Date: Mon Jul 13 23:28:05 2009
New Revision: 793747

URL: http://svn.apache.org/viewvc?rev=793747&view=rev
Log:
HDFS-462. loadFSImage should close edits file. Contributed by Jakob Homan.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=793747&r1=793746&r2=793747&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Mon Jul 13 23:28:05 2009
@@ -57,7 +57,7 @@
     HDFS-441. Remove TestFTPFileSystem.  (szetszwo)
 
     HDFS-440. Fix javadoc broken links in DFSClient.  (szetszwo)
-    
+
     HDFS-480. Fix a typo in the jar name in build.xml.  
     (Konstantin Shvachko via gkesavan)
 
@@ -67,6 +67,8 @@
     HDFS-415. BlockReceiver hangs in case of certain runtime exceptions.
     (Konstantin Boudnik via rangadi)
 
+    HDFS-462. loadFSImage should close edits file. (Jakob Homan via shv)
+
 Release 0.20.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java?rev=793747&r1=793746&r2=793747&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java Mon Jul
13 23:28:05 2009
@@ -47,6 +47,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.fs.permission.PermissionStatus;
+import org.apache.hadoop.hdfs.DeprecatedUTF8;
 import org.apache.hadoop.hdfs.protocol.Block;
 import org.apache.hadoop.hdfs.protocol.DatanodeID;
 import org.apache.hadoop.hdfs.protocol.FSConstants;
@@ -63,7 +64,6 @@
 import org.apache.hadoop.hdfs.server.protocol.NamenodeCommand;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeRegistration;
-import org.apache.hadoop.hdfs.DeprecatedUTF8;
 import org.apache.hadoop.io.Writable;
 
 /**
@@ -471,7 +471,14 @@
     case REGULAR:
       // just load the image
     }
-    return loadFSImage();
+    
+    boolean needToSave = loadFSImage();
+
+    assert editLog != null : "editLog must be initialized";
+    if(!editLog.isOpen())
+      editLog.open();
+    
+    return needToSave;
   }
 
   private void doUpgrade() throws IOException {
@@ -516,6 +523,7 @@
       assert curDir.exists() : "Current directory must exist.";
       assert !prevDir.exists() : "prvious directory must not exist.";
       assert !tmpDir.exists() : "prvious.tmp directory must not exist.";
+      assert !editLog.isOpen() : "Edits log must not be open.";
       // rename current to tmp
       rename(curDir, tmpDir);
       // save new image
@@ -979,10 +987,6 @@
     
     // Load latest edits
     needToSave |= (loadFSEdits(latestEditsSD) > 0);
-
-    assert editLog != null : "editLog must be initialized";
-    if(!editLog.isOpen())
-      editLog.open();
     
     return needToSave;
   }



Mime
View raw message