cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1151497 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/service/StorageService.java
Date Wed, 27 Jul 2011 15:25:15 GMT
Author: slebresne
Date: Wed Jul 27 15:25:14 2011
New Revision: 1151497

URL: http://svn.apache.org/viewvc?rev=1151497&view=rev
Log:
check column family input validity in nodetool repair
patch by yukim; reviewed by slebresne for CASSANDRA-2933

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1151497&r1=1151496&r2=1151497&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Wed Jul 27 15:25:14 2011
@@ -11,6 +11,7 @@
    (CASSANDRA-2946)
  * use lazy initialization instead of class initialization in NodeId
    (CASSANDRA-2953)
+ * check column family validity in nodetool repair (CASSANDRA-2933)
 
 
 0.8.2

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java?rev=1151497&r1=1151496&r2=1151497&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
Wed Jul 27 15:25:14 2011
@@ -1557,20 +1557,13 @@ public class StorageService implements I
 
     public AntiEntropyService.RepairSession forceTableRepair(final Range range, final String
tableName, final String... columnFamilies) throws IOException
     {
-        String[] families;
-        if (columnFamilies.length == 0)
+        ArrayList<String> names = new ArrayList<String>();
+        for (ColumnFamilyStore cfStore : getValidColumnFamilies(tableName, columnFamilies))
         {
-            ArrayList<String> names = new ArrayList<String>();
-            for (ColumnFamilyStore cfStore : getValidColumnFamilies(tableName)) {
-                names.add(cfStore.getColumnFamilyName());
-            }
-            families = names.toArray(new String[] {});
+            names.add(cfStore.getColumnFamilyName());
         }
-        else
-        {
-            families = columnFamilies;
-        }
-        AntiEntropyService.RepairSession sess = AntiEntropyService.instance.getRepairSession(range,
tableName, families);
+
+        AntiEntropyService.RepairSession sess = AntiEntropyService.instance.getRepairSession(range,
tableName, names.toArray(new String[names.size()]));
         sess.start();
         return sess;
     }



Mime
View raw message