cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [7/7] git commit: Expose secondary indexes to cfhistograms. Patch by brandonwilliams, reviewed by Nick Bailey for CASSANDRA-4063
Date Tue, 20 Mar 2012 02:43:01 GMT
Expose secondary indexes to cfhistograms.
Patch by brandonwilliams, reviewed by Nick Bailey for CASSANDRA-4063


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c573c46e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c573c46e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c573c46e

Branch: refs/heads/cassandra-1.1
Commit: c573c46e34b952e3147e36e8a7b097f701f2b0e4
Parents: f42ec6d
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Mon Mar 19 21:38:33 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Mon Mar 19 21:38:33 2012 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/tools/NodeProbe.java |   19 +++++++++-----
 1 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c573c46e/src/java/org/apache/cassandra/tools/NodeProbe.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 5cc6a60..64d71cb 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -30,10 +30,7 @@ import java.util.*;
 import java.util.Map.Entry;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
-import javax.management.JMX;
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
+import javax.management.*;
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
@@ -521,15 +518,23 @@ public class NodeProbe
         ColumnFamilyStoreMBean cfsProxy = null;
         try
         {
-            cfsProxy = JMX.newMBeanProxy(mbeanServerConn,
-                    new ObjectName("org.apache.cassandra.db:type=ColumnFamilies,keyspace="+ks+",columnfamily="+cf),

-                    ColumnFamilyStoreMBean.class);
+            Set<ObjectName> beans = mbeanServerConn.queryNames(new ObjectName("org.apache.cassandra.db:type=*ColumnFamilies,keyspace="
+ ks + ",columnfamily=" + cf), null);
+            if (beans.isEmpty())
+                throw new MalformedObjectNameException("couldn't find that bean");
+            assert beans.size() == 1;
+            for (ObjectName bean : beans)
+                cfsProxy = JMX.newMBeanProxy(mbeanServerConn, bean, ColumnFamilyStoreMBean.class);
         }
         catch (MalformedObjectNameException mone)
         {
             System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not found.");
             System.exit(1);
         }
+        catch (IOException e)
+        {
+            System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not found: "
+ e);
+            System.exit(1);
+        }
 
         return cfsProxy;
     }


Mime
View raw message