cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r822789 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: service/StorageService.java service/StorageServiceMBean.java tools/NodeProbe.java
Date Wed, 07 Oct 2009 16:23:15 GMT
Author: jbellis
Date: Wed Oct  7 16:23:14 2009
New Revision: 822789

URL: http://svn.apache.org/viewvc?rev=822789&view=rev
Log:
move javadoc into mbean.  inline methods where wrapping is not necessary to satisfy Demeter
patch by jbellis; reviewed by Eric Evans for CASSANDRA-385

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=822789&r1=822788&r2=822789&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Wed
Oct  7 16:23:14 2009
@@ -504,7 +504,6 @@
         return FileUtils.getUsedDiskSpace();
     }
 
-    /** Human-readable load value */
     public String getLoadString()
     {
         return FileUtils.stringifyFileSize(FileUtils.getUsedDiskSpace());
@@ -654,7 +653,7 @@
         return sb.toString();
     }
 
-    public void loadAll(String nodes) throws UnknownHostException
+    public void bootstrapNodes(String nodes) throws UnknownHostException
     {        
         doBootstrap(nodes);
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=822789&r1=822788&r2=822789&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
Wed Oct  7 16:23:14 2009
@@ -28,12 +28,52 @@
 
 public interface StorageServiceMBean
 {    
+    /**
+     * Retrieve the list of live nodes in the cluster, where "liveness" is
+     * determined by the failure detector of the node being queried. The
+     * returned string is a space delimited list of host:port end points.
+     *
+     * @return space delimited list of nodes
+     */
     public String getLiveNodes();
+
+    /**
+     * Retrieve the list of unreachable nodes in the cluster, as determined
+     * by this node's failure detector. The returned string is a space
+     * delimited list of host:port end points.
+     *
+     * @return space delimited list of nodes
+     */
     public String getUnreachableNodes();
+
+    /**
+     * Fetch a string representation of the token.
+     *
+     * @return a string token
+     */
     public String getToken();
+
+    /**
+     * Retrieve a map of range to end points that describe the ring topology
+     * of a Cassandra cluster.
+     *
+     * @return mapping of ranges to end points
+     */
     public Map<Range, List<EndPoint>> getRangeToEndPointMap();
+
+    /** Human-readable load value */
     public String getLoadString();
+
+    /**
+     * Return the generation value for this node.
+     *
+     * @return generation number
+     */
     public int getCurrentGenerationNumber();
+
+    /**
+     * Forces major compaction (all sstable files compacted)
+     */
     public void forceTableCompaction() throws IOException;
     
     /**
@@ -47,10 +87,10 @@
      *              to be bootstrapped
      * @throws UnknownHostException 
     */
-    public void loadAll(String nodes) throws UnknownHostException;
+    public void bootstrapNodes(String nodes) throws UnknownHostException;
     
     /**
-     * 
+     * Trigger a cleanup of keys on all tables.
      */
     public void forceTableCleanup() throws IOException;
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=822789&r1=822788&r2=822789&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java Wed Oct 
7 16:23:14 2009
@@ -172,96 +172,27 @@
         runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
                 mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
     }
-    
-    /**
-     * Retrieve a map of range to end points that describe the ring topology
-     * of a Cassandra cluster.
-     * 
-     * @return mapping of ranges to end points
-     */
-    public Map<Range, List<EndPoint>> getRangeToEndpointMap()
-    {
-        return ssProxy.getRangeToEndPointMap();
-    }
-    
-    /**
-     * Retrieve the list of live nodes in the cluster, where "liveness" is
-     * determined by the failure detector of the node being queried. The 
-     * returned string is a space delimited list of host:port end points.
-     * 
-     * @return space delimited list of nodes
-     */
-    public String getLiveNodes()
-    {
-        return ssProxy.getLiveNodes();
-    }
-    
-    /**
-     * Retrieve the list of unreachable nodes in the cluster, as determined
-     * by this node's failure detector. The returned string is a space
-     * delimited list of host:port end points.
-     * 
-     * @return space delimited list of nodes
-     */
-    public String getUnreachableNodes()
-    {
-        return ssProxy.getUnreachableNodes();
-    }
-    
-    /**
-     * Fetch a string representation of the token.
-     * 
-     * @return a string token
-     */
-    public String getToken()
-    {
-        return ssProxy.getToken();
-    }
-    
-    /**
-     * Return the generation value for this node.
-     * 
-     * @return generation number
-     */
-    public int getCurrentGenerationNumber()
-    {
-        return ssProxy.getCurrentGenerationNumber();
-    }
 
-    /**
-     * Trigger a cleanup of keys on all tables.
-     */
     public void forceTableCleanup() throws IOException
     {
         ssProxy.forceTableCleanup();
     }
     
-    /**
-     * Bootstrap the listed nodes with data
-     * @param nodeList a colon separated list of nodes to bootstrap
-     */
-    public void bootStrapNodes(String nodeList) throws UnknownHostException
+    public void bootstrapNodes(String nodeList) throws UnknownHostException
     {
-        ssProxy.loadAll(nodeList);
+        ssProxy.bootstrapNodes(nodeList);
     }
     
-    /**
-     * Trigger compaction of all tables.
-     */
     public void forceTableCompaction() throws IOException
     {
         ssProxy.forceTableCompaction();
     }
 
-    /**
-     * Trigger a binary flush on CFs of a table.
-     */
     public void forceTableFlushBinary(String tableName) throws IOException
     {
         ssProxy.forceTableFlushBinary(tableName);
     }
 
-
     /**
      * Write a textual representation of the Cassandra ring.
      * 
@@ -269,7 +200,7 @@
      */
     public void printRing(PrintStream outs)
     {
-        Map<Range, List<EndPoint>> rangeMap = getRangeToEndpointMap();
+        Map<Range, List<EndPoint>> rangeMap = ssProxy.getRangeToEndPointMap();
         List<Range> ranges = new ArrayList<Range>(rangeMap.keySet());
         Collections.sort(ranges);
         
@@ -408,15 +339,15 @@
      */
     public void printCluster(PrintStream outs)
     {
-        for (String upNode : getLiveNodes().split("\\s+"))
+        for (String upNode : ssProxy.getLiveNodes().split("\\s+"))
         {
             if (upNode.length() > 0)
             {
                 outs.println(String.format("%-21s up", upNode));
             }
         }
-        
-        for (String downNode : getUnreachableNodes().split("\\s+"))
+
+        for (String downNode : ssProxy.getUnreachableNodes().split("\\s+"))
         {
             if (downNode.length() > 0)
             {
@@ -432,9 +363,9 @@
      */
     public void printInfo(PrintStream outs)
     {
-        outs.println(getToken());
+        outs.println(ssProxy.getToken());
         outs.println(String.format("%-17s: %s", "Load", ssProxy.getLoadString()));
-        outs.println(String.format("%-17s: %s", "Generation No", getCurrentGenerationNumber()));
+        outs.println(String.format("%-17s: %s", "Generation No", ssProxy.getCurrentGenerationNumber()));
         
         // Uptime
         long secondsUp = runtimeProxy.getUptime() / 1000;
@@ -629,7 +560,7 @@
         {
             if (arguments.length == 2)
             {
-                probe.bootStrapNodes(arguments[1]);
+                probe.bootstrapNodes(arguments[1]);
             }
             else 
             {



Mime
View raw message