hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yjzhan...@apache.org
Subject hadoop git commit: HDFS-9519. Some coding improvement in SecondaryNameNode#main. (Xiao Chen via Yongjun Zhang)
Date Sat, 12 Dec 2015 05:22:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/bracnh-2.8 e39d947c2 -> 5e721df77


HDFS-9519. Some coding improvement in SecondaryNameNode#main. (Xiao Chen via Yongjun Zhang)

(cherry picked from commit 2a4c7d4facabb8b99d6dcbf4ccfe2afedf4fd445)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5e721df7
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5e721df7
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5e721df7

Branch: refs/heads/bracnh-2.8
Commit: 5e721df7775184eb325e5da85458fad451028f83
Parents: e39d947
Author: Yongjun Zhang <yzhang@cloudera.com>
Authored: Fri Dec 11 18:44:01 2015 -0800
Committer: Yongjun Zhang <yzhang@cloudera.com>
Committed: Fri Dec 11 21:22:42 2015 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt           |  3 +++
 .../hdfs/server/namenode/SecondaryNameNode.java       | 14 ++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e721df7/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 13edad5..acafb86 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -847,6 +847,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9532. Detailed exception info is lost in reportTo methods of
     ErrorReportAction and ReportBadBlockAction. (Yongjun Zhang)
 
+    HDFS-9519. Some coding improvement in SecondaryNameNode#main.
+    (Xiao Chen via Yongjun Zhang)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e721df7/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
index 9909d4a..acb2c8a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
@@ -679,18 +679,16 @@ public class SecondaryNameNode implements Runnable,
       SecondaryNameNode secondary = null;
       secondary = new SecondaryNameNode(tconf, opts);
 
+      // SecondaryNameNode can be started in 2 modes:
+      // 1. run a command (i.e. checkpoint or geteditsize) then terminate
+      // 2. run as a daemon when {@link #parseArgs} yields no commands
       if (opts != null && opts.getCommand() != null) {
+        // mode 1
         int ret = secondary.processStartupCommand(opts);
         terminate(ret);
-      }
-
-      if (secondary != null) {
-        // The web server is only needed when starting SNN as a daemon,
-        // and not needed if called from shell command. Starting the web server
-        // from shell may fail when getting credentials, if the environment
-        // is not set up for it, which is most of the case.
+      } else {
+        // mode 2
         secondary.startInfoServer();
-
         secondary.startCheckpointThread();
         secondary.join();
       }


Mime
View raw message