cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Add nodetool command to refresh system.size_estimates
Date Thu, 12 Nov 2015 18:00:56 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 9ab1c8372 -> ecd66de2b


Add nodetool command to refresh system.size_estimates


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

Branch: refs/heads/cassandra-2.1
Commit: ecd66de2bdf2ecb88c4276a4616a76f5ec2921bb
Parents: 9ab1c83
Author: Carl Yeksigian <carl@apache.org>
Authored: Tue Nov 10 17:22:11 2015 +0000
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Nov 12 17:53:33 2015 +0000

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 .../org/apache/cassandra/service/StorageService.java    |  6 ++++++
 .../apache/cassandra/service/StorageServiceMBean.java   |  5 +++++
 src/java/org/apache/cassandra/tools/NodeProbe.java      | 12 ++++++++++++
 src/java/org/apache/cassandra/tools/NodeTool.java       | 11 +++++++++++
 5 files changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecd66de2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d0c0af9..2eeda94 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.12
+ * Add a nodetool command to refresh size_estimates (CASSANDRA-9579)
  * Shutdown compaction in drain to prevent leak (CASSANDRA-10079)
  * Invalidate cache after stream receive task is completed (CASSANDRA-10341)
  * Reject counter writes in CQLSSTableWriter (CASSANDRA-10258)
@@ -33,6 +34,7 @@
  * Mark nodes as dead even if they've already left (CASSANDRA-10205)
  * Update internal python driver used by cqlsh (CASSANDRA-10161, CASSANDRA-10507)
 
+
 2.1.10
  * Bulk Loader API could not tolerate even node failure (CASSANDRA-10347)
  * Avoid misleading pushed notifications when multiple nodes

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecd66de2/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 93b1b97..665ce3a 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -83,6 +83,7 @@ import org.apache.cassandra.db.MutationVerbHandler;
 import org.apache.cassandra.db.ReadRepairVerbHandler;
 import org.apache.cassandra.db.ReadVerbHandler;
 import org.apache.cassandra.db.SchemaCheckVerbHandler;
+import org.apache.cassandra.db.SizeEstimatesRecorder;
 import org.apache.cassandra.db.SnapshotDetailsTabularData;
 import org.apache.cassandra.db.SystemKeyspace;
 import org.apache.cassandra.db.TruncateVerbHandler;
@@ -2604,6 +2605,11 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
         return total;
     }
 
+    public void refreshSizeEstimates() throws ExecutionException
+    {
+        FBUtilities.waitOnFuture(ScheduledExecutors.optionalTasks.submit(SizeEstimatesRecorder.instance));
+    }
+
     /**
      * @param allowIndexes Allow index CF names to be passed in
      * @param autoAddIndexes Automatically add secondary indexes if a CF has them

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecd66de2/src/java/org/apache/cassandra/service/StorageServiceMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index b8582a3..1351fea 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -248,6 +248,11 @@ public interface StorageServiceMBean extends NotificationEmitter
     public long trueSnapshotsSize();
 
     /**
+     * Forces refresh of values stored in system.size_estimates of all column families.
+     */
+    public void refreshSizeEstimates() throws ExecutionException;
+
+    /**
      * Forces major compaction of a single keyspace
      */
     public void forceKeyspaceCompaction(String keyspaceName, String... columnFamilies) throws
IOException, ExecutionException, InterruptedException;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecd66de2/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 6f2b6fb..49c493d 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -901,6 +901,18 @@ public class NodeProbe implements AutoCloseable
         }
     }
 
+    public void refreshSizeEstimates()
+    {
+        try
+        {
+            ssProxy.refreshSizeEstimates();
+        }
+        catch (ExecutionException e)
+        {
+            throw new RuntimeException("Error while refreshing system.size_estimates", e);
+        }
+    }
+
     public void stopNativeTransport()
     {
         ssProxy.stopNativeTransport();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecd66de2/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java
index 277f42c..1d4a420 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -151,6 +151,7 @@ public class NodeTool
                 ProxyHistograms.class,
                 Rebuild.class,
                 Refresh.class,
+                RefreshSizeEstimates.class,
                 RemoveToken.class,
                 RemoveNode.class,
                 Repair.class,
@@ -1807,6 +1808,16 @@ public class NodeTool
         }
     }
 
+    @Command(name = "refreshsizeestimates", description = "Refresh system.size_estimates")
+    public static class RefreshSizeEstimates extends NodeToolCmd
+    {
+        @Override
+        public void execute(NodeProbe probe)
+        {
+            probe.refreshSizeEstimates();
+        }
+    }
+
     @Deprecated
     @Command(name = "removetoken", description = "DEPRECATED (see removenode)", hidden =
true)
     public static class RemoveToken extends NodeToolCmd


Mime
View raw message