hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From larsgeo...@apache.org
Subject svn commit: r901402 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
Date Wed, 20 Jan 2010 22:09:48 GMT
Author: larsgeorge
Date: Wed Jan 20 22:09:47 2010
New Revision: 901402

URL: http://svn.apache.org/viewvc?rev=901402&view=rev
Log:
HBASE-2146  RPC related metrics are missing in 0.20.3 since recent changes (Gary Helmling
via Lars George)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=901402&r1=901401&r2=901402&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Jan 20 22:09:47 2010
@@ -180,6 +180,8 @@
    HBASE-2139  findbugs task in build.xml (Kay Kay via Stack)
    HBASE-2147  run zookeeper in the same jvm as master during non-distributed mode
    HBASE-1360  move up to Thrift 0.2.0 (Kay Kay and Lars Francke via Stack)
+   HBASE-2146  RPC related metrics are missing in 0.20.3 since recent changes
+               (Gary Helmling via Lars George)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java?rev=901402&r1=901401&r2=901402&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java Wed Jan 20 22:09:47
2010
@@ -31,6 +31,7 @@
 import java.net.SocketTimeoutException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
@@ -115,6 +116,10 @@
     return localCode;
   }
   
+  static Collection<String> getMappedMethodNames() {
+    return Invocation.CODE_TO_METHODNAME.values();
+  }
+
   static {
     code = HBaseRPC.addToMap(VersionedProtocol.class, code);
     code = HBaseRPC.addToMap(HMasterInterface.class, code);
@@ -656,8 +661,6 @@
           LOG.debug("Served: " + call.getMethodName() +
             " queueTime= " + qTime +
             " procesingTime= " + processingTime);
-          rpcMetrics.rpcQueueTime.inc(qTime);
-          rpcMetrics.rpcProcessingTime.inc(processingTime);
         }
         rpcMetrics.rpcQueueTime.inc(qTime);
         rpcMetrics.rpcProcessingTime.inc(processingTime);

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java?rev=901402&r1=901401&r2=901402&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java Wed Jan 20
22:09:47 2010
@@ -54,6 +54,7 @@
 
     context.registerUpdater(this);
     
+    this.initMethods();
     rpcStatistics = new HBaseRPCStatistics(this.registry, hostName, port);
   }
   
@@ -70,6 +71,17 @@
 
   //public Map <String, MetricsTimeVaryingRate> metricsList = Collections.synchronizedMap(new
HashMap<String, MetricsTimeVaryingRate>());
 
+  /**
+   * Register metrics for all know RPC methods ahead of time.  This helps with
+   * JMX usage, where trying to retrieve the RPC-method metrics before they're
+   * incremented could otherwise cause spurious AttributeNotFoundExceptions.
+   */
+  private void initMethods() {
+    for (String name : HBaseRPC.getMappedMethodNames()) {
+      create(name);
+    }
+  }
+
   private MetricsTimeVaryingRate get(String key) {
     return (MetricsTimeVaryingRate) registry.get(key);
   }



Mime
View raw message