hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject svn commit: r1586903 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
Date Sat, 12 Apr 2014 21:46:13 GMT
Author: cnauroth
Date: Sat Apr 12 21:46:13 2014
New Revision: 1586903

URL: http://svn.apache.org/r1586903
Log:
HDFS-6236. Merging change r1586902 from trunk to branch-2.

Modified:
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1586903&r1=1586902&r2=1586903&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sat Apr 12
21:46:13 2014
@@ -137,6 +137,9 @@ Release 2.4.1 - UNRELEASED
     HDFS-6232. OfflineEditsViewer throws a NPE on edits containing ACL
     modifications (ajisakaa via cmccabe)
 
+    HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency.
+    (cnauroth)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java?rev=1586903&r1=1586902&r2=1586903&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageServlet.java
Sat Apr 12 21:46:13 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hdfs.server.namenode;
 
-import static org.apache.hadoop.util.Time.now;
+import static org.apache.hadoop.util.Time.monotonicNow;
 
 import java.net.HttpURLConnection;
 import java.security.PrivilegedExceptionAction;
@@ -116,11 +116,11 @@ public class ImageServlet extends HttpSe
               throw new IOException(errorMessage);
             }
             CheckpointFaultInjector.getInstance().beforeGetImageSetsHeaders();
-            long start = now();
+            long start = monotonicNow();
             serveFile(imageFile);
 
             if (metrics != null) { // Metrics non-null only when used inside name node
-              long elapsed = now() - start;
+              long elapsed = monotonicNow() - start;
               metrics.addGetImage(elapsed);
             }
           } else if (parsedParams.isGetEdit()) {
@@ -129,11 +129,11 @@ public class ImageServlet extends HttpSe
             
             File editFile = nnImage.getStorage()
                 .findFinalizedEditsFile(startTxId, endTxId);
-            long start = now();
+            long start = monotonicNow();
             serveFile(editFile);
 
             if (metrics != null) { // Metrics non-null only when used inside name node
-              long elapsed = now() - start;
+              long elapsed = monotonicNow() - start;
               metrics.addGetEdit(elapsed);
             }
           }
@@ -469,7 +469,7 @@ public class ImageServlet extends HttpSe
 
                 InputStream stream = request.getInputStream();
                 try {
-                  long start = now();
+                  long start = monotonicNow();
                   MD5Hash downloadImageDigest = TransferFsImage
                       .handleUploadImageRequest(request, txid,
                           nnImage.getStorage(), stream,
@@ -478,7 +478,7 @@ public class ImageServlet extends HttpSe
                       downloadImageDigest);
                   // Metrics non-null only when used inside name node
                   if (metrics != null) {
-                    long elapsed = now() - start;
+                    long elapsed = monotonicNow() - start;
                     metrics.addPutImage(elapsed);
                   }
                   // Now that we have a new checkpoint, we might be able to

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java?rev=1586903&r1=1586902&r2=1586903&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
Sat Apr 12 21:46:13 2014
@@ -1900,7 +1900,12 @@ public class TestCheckpoint {
           .format(true).build();
       int origPort = cluster.getNameNodePort();
       int origHttpPort = cluster.getNameNode().getHttpAddress().getPort();
-      secondary = startSecondaryNameNode(conf);
+      Configuration snnConf = new Configuration(conf);
+      File checkpointDir = new File(MiniDFSCluster.getBaseDirectory(),
+        "namesecondary");
+      snnConf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_DIR_KEY,
+        checkpointDir.getAbsolutePath());
+      secondary = startSecondaryNameNode(snnConf);
 
       // secondary checkpoints once
       secondary.doCheckpoint();



Mime
View raw message