hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject svn commit: r1590197 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: ./ src/main/java/org/apache/hadoop/hdfs/server/namenode/ src/main/webapps/secondary/ src/test/java/org/apache/hadoop/hdfs/server/namenode/
Date Fri, 25 Apr 2014 23:49:11 GMT
Author: wheat9
Date: Fri Apr 25 23:49:10 2014
New Revision: 1590197

URL: http://svn.apache.org/r1590197
Log:
HDFS-6270. Secondary namenode status page shows transaction count in bytes. Contributed by
Benoy Antony.

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/status.html
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSecondaryWebUi.java

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1590197&r1=1590196&r2=1590197&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Fri Apr 25 23:49:10 2014
@@ -406,6 +406,9 @@ Release 2.5.0 - UNRELEASED
 
     HDFS-5865. Update OfflineImageViewer document. (Akira Ajisaka via wheat9)
 
+    HDFS-6270. Secondary namenode status page shows transaction count in bytes.
+    (Benoy Antony via wheat9)
+
 Release 2.4.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java?rev=1590197&r1=1590196&r2=1590197&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
Fri Apr 25 23:49:10 2014
@@ -78,7 +78,6 @@ import org.apache.hadoop.util.Time;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
 import org.apache.hadoop.util.VersionInfo;
 
 import javax.management.ObjectName;
@@ -130,16 +129,15 @@ public class SecondaryNameNode implement
   @Override
   public String toString() {
     return getClass().getSimpleName() + " Status" 
-      + "\nName Node Address    : " + nameNodeAddr   
-      + "\nStart Time           : " + new Date(starttime)
-      + "\nLast Checkpoint      : " + (lastCheckpointTime == 0? "--":
+      + "\nName Node Address      : " + nameNodeAddr
+      + "\nStart Time             : " + new Date(starttime)
+      + "\nLast Checkpoint        : " + (lastCheckpointTime == 0? "--":
 				       ((Time.monotonicNow() - lastCheckpointTime) / 1000))
 	                            + " seconds ago"
-      + "\nCheckpoint Period    : " + checkpointConf.getPeriod() + " seconds"
-      + "\nCheckpoint Size      : " + StringUtils.byteDesc(checkpointConf.getTxnCount())
-                                    + " (= " + checkpointConf.getTxnCount() + " bytes)" 
-      + "\nCheckpoint Dirs      : " + checkpointDirs
-      + "\nCheckpoint Edits Dirs: " + checkpointEditsDirs;
+      + "\nCheckpoint Period      : " + checkpointConf.getPeriod() + " seconds"
+      + "\nCheckpoint Transactions: " + checkpointConf.getTxnCount()
+      + "\nCheckpoint Dirs        : " + checkpointDirs
+      + "\nCheckpoint Edits Dirs  : " + checkpointEditsDirs;
   }
 
   @VisibleForTesting

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/status.html
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/status.html?rev=1590197&r1=1590196&r2=1590197&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/status.html
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/status.html
Fri Apr 25 23:49:10 2014
@@ -66,7 +66,7 @@
   <tr><th>Started</th><td>{StartTime|date_tostring}</td></tr>
   <tr><th>Last Checkpoint</th><td>{@if cond="{LastCheckpointTime}
=== 0"}Never{:else}{LastCheckpointTime|date_tostring}{/if}</td></tr>
   <tr><th>Checkpoint Period</th><td>{CheckpointPeriod} seconds</td></tr>
-  <tr><th>Checkpoint Size</th><td>{TxnCount|fmt_bytes}</td></tr>
+  <tr><th>Checkpoint Transactions</th><td>{TxnCount}</td></tr>
 </table>
 
 <div class="page-header"><h2><small>Checkpoint Image URI</small></h2></div>

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSecondaryWebUi.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSecondaryWebUi.java?rev=1590197&r1=1590196&r2=1590197&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSecondaryWebUi.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestSecondaryWebUi.java
Fri Apr 25 23:49:10 2014
@@ -17,8 +17,11 @@
  */
 package org.apache.hadoop.hdfs.server.namenode;
 
+import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_TXNS_KEY;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
+import org.apache.hadoop.hdfs.DFSTestUtil;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -28,6 +31,7 @@ import org.junit.Test;
 import javax.management.*;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
+import java.net.URL;
 
 public class TestSecondaryWebUi {
   
@@ -39,6 +43,7 @@ public class TestSecondaryWebUi {
   public static void setUpCluster() throws IOException {
     conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY,
         "0.0.0.0:0");
+    conf.setLong(DFS_NAMENODE_CHECKPOINT_TXNS_KEY, 500);
     cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0)
         .build();
     cluster.waitActive();
@@ -73,4 +78,18 @@ public class TestSecondaryWebUi {
     Assert.assertArrayEquals(checkpointEditlogDir,
             snn.getCheckpointEditlogDirectories());
   }
+
+  @Test
+  public void testSecondaryWebUiJsp()
+          throws IOException, MalformedObjectNameException,
+                 AttributeNotFoundException, MBeanException,
+                 ReflectionException, InstanceNotFoundException {
+    String pageContents = DFSTestUtil.urlGet(new URL("http://localhost:" +
+        SecondaryNameNode.getHttpAddress(conf).getPort() + "/status.jsp"));
+    Assert.assertTrue("Didn't find \"Last Checkpoint\"",
+        pageContents.contains("Last Checkpoint"));
+    Assert.assertTrue("Didn't find Checkpoint Transactions: 500",
+        pageContents.contains("Checkpoint Transactions: 500"));
+
+  }
 }



Mime
View raw message