Ver código fonte

HADOOP-5714. Add a metric for NameNode getFileInfo operation. Contributed by Jakob Homan

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@774141 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 anos atrás
pai
commit
34c70aad18

+ 3 - 0
CHANGES.txt

@@ -425,6 +425,9 @@ Release 0.20.0 - 2009-04-15
     HADOOP-5521. Removes dependency of TestJobInProgress on RESTART_COUNT 
     HADOOP-5521. Removes dependency of TestJobInProgress on RESTART_COUNT 
     JobHistory tag. (Ravi Gummadi via ddas)
     JobHistory tag. (Ravi Gummadi via ddas)
 
 
+    HADOOP-5714. Add a metric for NameNode getFileInfo operation. (Jakob Homan
+    via szetszwo)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     HADOOP-3293. Fixes FileInputFormat to do provide locations for splits
     HADOOP-3293. Fixes FileInputFormat to do provide locations for splits

+ 0 - 3
src/core/org/apache/hadoop/metrics/util/MetricsRegistry.java

@@ -20,9 +20,6 @@ package org.apache.hadoop.metrics.util;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
 
 
 /**
 /**
  * 
  * 

+ 1 - 0
src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -568,6 +568,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
    *         or null if file not found
    *         or null if file not found
    */
    */
   public FileStatus getFileInfo(String src)  throws IOException {
   public FileStatus getFileInfo(String src)  throws IOException {
+    myMetrics.numFileInfoOps.inc();
     return namesystem.getFileInfo(src);
     return namesystem.getFileInfo(src);
   }
   }
 
 

+ 2 - 0
src/hdfs/org/apache/hadoop/hdfs/server/namenode/metrics/NameNodeMetrics.java

@@ -62,6 +62,8 @@ public class NameNodeMetrics implements Updater {
                     new MetricsTimeVaryingInt("CreateFileOps", registry);
                     new MetricsTimeVaryingInt("CreateFileOps", registry);
     public MetricsTimeVaryingInt numDeleteFileOps = 
     public MetricsTimeVaryingInt numDeleteFileOps = 
                           new MetricsTimeVaryingInt("DeleteFileOps", registry);
                           new MetricsTimeVaryingInt("DeleteFileOps", registry);
+    public MetricsTimeVaryingInt numFileInfoOps =
+                          new MetricsTimeVaryingInt("FileInfoOps", registry);
     public MetricsTimeVaryingInt numAddBlockOps = 
     public MetricsTimeVaryingInt numAddBlockOps = 
                           new MetricsTimeVaryingInt("AddBlockOps", registry);
                           new MetricsTimeVaryingInt("AddBlockOps", registry);