浏览代码

HDFS-2308. svn merge -c 1196113 from trunk

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1196115 13f79535-47bb-0310-9956-ffa450edef68
Eli Collins 13 年之前
父节点
当前提交
8e799e112a

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -764,6 +764,9 @@ Release 0.23.0 - 2011-11-01
     HDFS-2521. Remove custom checksum headers from data transfer protocol
     HDFS-2521. Remove custom checksum headers from data transfer protocol
     (todd)
     (todd)
 
 
+    HDFS-2308. NamenodeProtocol.endCheckpoint is vestigial and can be removed.
+    (eli)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     HDFS-1458. Improve checkpoint performance by avoiding unnecessary image
     HDFS-1458. Improve checkpoint performance by avoiding unnecessary image

+ 4 - 10
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java

@@ -963,18 +963,12 @@ public class FSImage implements Closeable {
   /**
   /**
    * End checkpoint.
    * End checkpoint.
    * <p>
    * <p>
-   * Rename uploaded checkpoint to the new image;
-   * purge old edits file;
-   * rename edits.new to edits;
-   * redirect edit log streams to the new edits;
-   * update checkpoint time if the remote node is a checkpoint only node.
+   * Validate the current storage info with the given signature.
    * 
    * 
-   * @param sig
-   * @param remoteNNRole
-   * @throws IOException
+   * @param sig to validate the current storage info against
+   * @throws IOException if the checkpoint fields are inconsistent
    */
    */
-  void endCheckpoint(CheckpointSignature sig,
-                     NamenodeRole remoteNNRole) throws IOException {
+  void endCheckpoint(CheckpointSignature sig) throws IOException {
     sig.validateStorageInfo(this);
     sig.validateStorageInfo(this);
   }
   }
 
 

+ 3 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -3440,15 +3440,15 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
 
 
   void endCheckpoint(NamenodeRegistration registration,
   void endCheckpoint(NamenodeRegistration registration,
                             CheckpointSignature sig) throws IOException {
                             CheckpointSignature sig) throws IOException {
-    writeLock();
+    readLock();
     try {
     try {
       if (isInSafeMode()) {
       if (isInSafeMode()) {
         throw new SafeModeException("Checkpoint not ended", safeMode);
         throw new SafeModeException("Checkpoint not ended", safeMode);
       }
       }
       LOG.info("End checkpoint for " + registration.getAddress());
       LOG.info("End checkpoint for " + registration.getAddress());
-      getFSImage().endCheckpoint(sig, registration.getRole());
+      getFSImage().endCheckpoint(sig);
     } finally {
     } finally {
-      writeUnlock();
+      readUnlock();
     }
     }
   }
   }