cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1101792 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/db/SystemTable.java
Date Wed, 11 May 2011 09:10:54 GMT
Author: slebresne
Date: Wed May 11 09:10:54 2011
New Revision: 1101792

URL: http://svn.apache.org/viewvc?rev=1101792&view=rev
Log:
Allow removing LocationInfo sstables (to allow cluster rename)
patch by amorton; reviewed by slebresne for CASSANDRA-2632

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/SystemTable.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1101792&r1=1101791&r2=1101792&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Wed May 11 09:10:54 2011
@@ -17,6 +17,7 @@
  * Don't allow {LOCAL|EACH}_QUORUM unless strategy is NTS (CASSANDRA-2627)
  * Fix regression where bootstrapping a node with no schema fails
    (CASSANDRA-2625)
+ * Allow removing LocationInfo sstables (CASSANDRA-2632)
 
 
 0.7.5

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/SystemTable.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/SystemTable.java?rev=1101792&r1=1101791&r2=1101792&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/SystemTable.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/SystemTable.java Wed
May 11 09:10:54 2011
@@ -221,18 +221,9 @@ public class SystemTable
         if (cf == null)
         {
             // this is either a brand new node (there will be no files), or the partitioner
was changed from RP to OPP.
-            for (String path : DatabaseDescriptor.getAllDataFileLocationsForTable("system"))
-            {
-                File[] dbContents = new File(path).listFiles(new FilenameFilter()
-                {
-                    public boolean accept(File dir, String name)
-                    {
-                        return name.endsWith(".db");
-                    }
-                }); 
-                if (dbContents.length > 0)
-                    throw new ConfigurationException("Found system table files, but they
couldn't be loaded. Did you change the partitioner?");
-            }
+            ColumnFamilyStore cfs = table.getColumnFamilyStore(STATUS_CF);
+            if (!cfs.getSSTables().isEmpty())
+                throw new ConfigurationException("Found system table files, but they couldn't
be loaded. Did you change the partitioner?");
 
             // no system files.  this is a new node.
             RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, LOCATION_KEY);



Mime
View raw message