hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r980639 - in /hbase/branches/0.89.20100726: CHANGES.txt src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
Date Fri, 30 Jul 2010 03:26:00 GMT
Author: stack
Date: Fri Jul 30 03:25:59 2010
New Revision: 980639

URL: http://svn.apache.org/viewvc?rev=980639&view=rev
Log:
HBASE-2890 (HBASE-2890) Initialize RPC JMX metrics on startup

Modified:
    hbase/branches/0.89.20100726/CHANGES.txt
    hbase/branches/0.89.20100726/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java

Modified: hbase/branches/0.89.20100726/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100726/CHANGES.txt?rev=980639&r1=980638&r2=980639&view=diff
==============================================================================
--- hbase/branches/0.89.20100726/CHANGES.txt (original)
+++ hbase/branches/0.89.20100726/CHANGES.txt Fri Jul 30 03:25:59 2010
@@ -1,5 +1,5 @@
 HBase Change Log
-Release 0.90 - Unreleased
+Release 0.89.2010726
   INCOMPATIBLE CHANGES
    HBASE-1822  Remove the deprecated APIs
    HBASE-1848  Fixup shell for HBASE-1822
@@ -457,6 +457,7 @@ Release 0.90 - Unreleased
    HBASE-2815  not able to run the test suite in background because TestShell
                gets suspended on tty output (Alexey Kovyrin via Stack)
    HBASE-2852  Bloom filter NPE (pranav via jgray)
+   HBASE-2890  Initialize RPC JMX metrics on startup (Gary Helmling via Stack)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hbase/branches/0.89.20100726/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100726/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java?rev=980639&r1=980638&r2=980639&view=diff
==============================================================================
--- hbase/branches/0.89.20100726/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
(original)
+++ hbase/branches/0.89.20100726/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
Fri Jul 30 03:25:59 2010
@@ -29,6 +29,8 @@ import org.apache.hadoop.metrics.Updater
 import org.apache.hadoop.metrics.util.MetricsRegistry;
 import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
 
+import java.lang.reflect.Method;
+
 /**
  *
  * This class is for maintaining  the various RPC statistics
@@ -57,6 +59,9 @@ public class HBaseRpcMetrics implements 
 
     context.registerUpdater(this);
 
+    initMethods(HMasterInterface.class);
+    initMethods(HMasterRegionInterface.class);
+    initMethods(HRegionInterface.class);
     rpcStatistics = new HBaseRPCStatistics(this.registry, hostName, port);
   }
 
@@ -73,6 +78,12 @@ public class HBaseRpcMetrics implements 
 
   //public Map <String, MetricsTimeVaryingRate> metricsList = Collections.synchronizedMap(new
HashMap<String, MetricsTimeVaryingRate>());
 
+  private void initMethods(Class<? extends HBaseRPCProtocolVersion> protocol) {
+    for (Method m : protocol.getDeclaredMethods()) {
+      if (get(m.getName()) == null)
+        create(m.getName());
+    }
+  }
 
   private MetricsTimeVaryingRate get(String key) {
     return (MetricsTimeVaryingRate) registry.get(key);



Mime
View raw message