hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r681436 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java
Date Thu, 31 Jul 2008 18:44:54 GMT
Author: cdouglas
Date: Thu Jul 31 11:44:53 2008
New Revision: 681436

URL: http://svn.apache.org/viewvc?rev=681436&view=rev
Log:
HADOOP-3865. Remove reference to FSNamesystem from metrics preventing
garbage collection. Contributed by Lohit Vijayarenu

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=681436&r1=681435&r2=681436&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Thu Jul 31 11:44:53 2008
@@ -776,6 +776,9 @@
     HADOOP-3855. Fixes an import problem introduced by HADOOP-3827.
     (Arun Murthy via ddas)
 
+    HADOOP-3865. Remove reference to FSNamesystem from metrics preventing
+    garbage collection. (Lohit Vijayarenu via cdouglas)
+
 Release 0.17.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java?rev=681436&r1=681435&r2=681436&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java Thu
Jul 31 11:44:53 2008
@@ -376,7 +376,6 @@
    */
   FSNamesystem(FSImage fsImage, Configuration conf) throws IOException {
     setConfigurationParameters(conf);
-    this.registerMBean(conf);
     this.dir = new FSDirectory(fsImage, this, conf);
   }
 
@@ -4265,7 +4264,7 @@
     // package naming for mbeans and their impl.
     StandardMBean bean;
     try {
-      myFSMetrics = new FSNamesystemMetrics(conf, this);
+      myFSMetrics = new FSNamesystemMetrics(conf);
       bean = new StandardMBean(this,FSNamesystemMBean.class);
       mbeanName = MBeanUtil.registerMBean("NameNode", "FSNamesystemStatus", bean);
     } catch (NotCompliantMBeanException e) {

Modified: hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java?rev=681436&r1=681435&r2=681436&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java
(original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/FSNamesystemMetrics.java
Thu Jul 31 11:44:53 2008
@@ -21,10 +21,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.metrics.*;
-import org.apache.hadoop.metrics.jvm.JvmMetrics;
 import org.apache.hadoop.metrics.util.MetricsIntValue;
-import org.apache.hadoop.metrics.util.MetricsTimeVaryingInt;
-import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
 
 /**
  * 
@@ -52,9 +49,8 @@
   public MetricsIntValue pendingReplicationBlocks = new MetricsIntValue("PendingReplicationBlocks");
   public MetricsIntValue underReplicatedBlocks = new MetricsIntValue("UnderReplicatedBlocks");
   public MetricsIntValue scheduledReplicationBlocks = new MetricsIntValue("ScheduledReplicationBlocks");
-  FSNamesystemMetrics(Configuration conf, FSNamesystem fsNameSystem) {
+  FSNamesystemMetrics(Configuration conf) {
     String sessionId = conf.get("session.id");
-    this.fsNameSystem = fsNameSystem;
      
     // Create a record for FSNamesystem metrics
     MetricsContext metricsContext = MetricsUtil.getContext("dfs");
@@ -64,10 +60,6 @@
     log.info("Initializing FSNamesystemMeterics using context object:" +
               metricsContext.getClass().getName());
   }
-  public void shutdown() {
-    if (fsNameSystem != null) 
-      fsNameSystem.shutdown();
-  }
 
   private int roundBytesToGBytes(long bytes) {
     return Math.round(((float)bytes/(1024 * 1024 * 1024)));
@@ -88,6 +80,7 @@
    */
   public void doUpdates(MetricsContext unused) {
     synchronized (this) {
+      FSNamesystem fsNameSystem = FSNamesystem.getFSNamesystem();
       filesTotal.set((int)fsNameSystem.getFilesTotal());
       filesTotal.pushMetric(metricsRecord);
 



Mime
View raw message