cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1027767 - in /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools: ClusterCmd.java NodeProbe.java
Date Tue, 26 Oct 2010 23:11:19 GMT
Author: jbellis
Date: Tue Oct 26 23:11:19 2010
New Revision: 1027767

URL: http://svn.apache.org/viewvc?rev=1027767&view=rev
Log:
add NodeProbe close method.  patch by Bill Au; reviewed by jbellis for CASSANDRA-1665

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/ClusterCmd.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/ClusterCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/ClusterCmd.java?rev=1027767&r1=1027766&r2=1027767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/ClusterCmd.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/ClusterCmd.java Tue
Oct 26 23:11:19 2010
@@ -146,6 +146,11 @@ public class ClusterCmd {
         hf.printHelp(usage, "", options, header);
     }
     
+    public void close() throws IOException
+    {
+        probe.close(); 
+    }
+
     public void printEndpoints(String keyspace, String key)
     {
         List<InetAddress> endpoints = probe.getEndpoints(keyspace, key);

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=1027767&r1=1027766&r2=1027767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java Tue
Oct 26 23:11:19 2010
@@ -64,6 +64,7 @@ public class NodeProbe
     private String host;
     private int port;
 
+    private JMXConnector jmxc;
     private MBeanServerConnection mbeanServerConn;
     private StorageServiceMBean ssProxy;
     private MemoryMXBean memProxy;
@@ -105,7 +106,7 @@ public class NodeProbe
     private void connect() throws IOException
     {
         JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
-        JMXConnector jmxc = JMXConnectorFactory.connect(jmxUrl, null);
+        jmxc = JMXConnectorFactory.connect(jmxUrl, null);
         mbeanServerConn = jmxc.getMBeanServerConnection();
         
         try
@@ -126,6 +127,11 @@ public class NodeProbe
                 mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
     }
 
+    public void close() throws IOException
+    {
+        jmxc.close();
+    }
+
     public void forceTableCleanup() throws IOException, ExecutionException, InterruptedException
     {
         ssProxy.forceTableCleanup();



Mime
View raw message