cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/3] cassandra git commit: Fix deprecated repair JMX API
Date Thu, 11 Jun 2015 14:55:06 GMT
Fix deprecated repair JMX API

patch by yukim; reviewed by marcuse for CASSANDRA-9570


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

Branch: refs/heads/trunk
Commit: cab33a60957525854238c61f9360ba58d04d318b
Parents: 3ee27fb
Author: Yuki Morishita <yukim@apache.org>
Authored: Tue Jun 9 16:20:54 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Jun 11 09:52:58 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../org/apache/cassandra/service/StorageService.java | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cab33a60/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3163351..72da59f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,7 @@
 2.2
  * Add functions to convert timeuuid to date or time, deprecate dateOf and unixTimestampOf
(CASSANDRA-9229)
  * Make sure we cancel non-compacting sstables from LifecycleTransaction (CASSANDRA-9566)
+ * Fix deprecated repair JMX API (CASSANDRA-9570)
 
 
 2.2.0-rc1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cab33a60/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 e059348..2dd56b5 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2807,6 +2807,21 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
         {
             options.getHosts().addAll(hosts);
         }
+        if (primaryRange)
+        {
+            // when repairing only primary range, neither dataCenters nor hosts can be set
+            if (options.getDataCenters().isEmpty() && options.getHosts().isEmpty())
+                options.getRanges().addAll(getPrimaryRanges(keyspace));
+                // except dataCenters only contain local DC (i.e. -local)
+            else if (options.getDataCenters().size() == 1 && options.getDataCenters().contains(DatabaseDescriptor.getLocalDataCenter()))
+                options.getRanges().addAll(getPrimaryRangesWithinDC(keyspace));
+            else
+                throw new IllegalArgumentException("You need to run primary range repair
on all nodes in the cluster.");
+        }
+        else
+        {
+            options.getRanges().addAll(getLocalRanges(keyspace));
+        }
         if (columnFamilies != null)
         {
             for (String columnFamily : columnFamilies)


Mime
View raw message