cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r997490 - in /cassandra/trunk/src/java/org/apache/cassandra: db/ColumnFamilyStore.java db/Table.java service/AbstractCassandraDaemon.java
Date Wed, 15 Sep 2010 20:38:53 GMT
Author: gdusbabek
Date: Wed Sep 15 20:38:53 2010
New Revision: 997490

URL: http://svn.apache.org/viewvc?rev=997490&view=rev
Log:
move directory scrubbing to startup. patch by gdusbabek, reviewed by jbellis. CASSANDRA-1477

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
    cassandra/trunk/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=997490&r1=997489&r2=997490&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Sep 15 20:38:53
2010
@@ -302,7 +302,7 @@ public class ColumnFamilyStore implement
      * and compacted sstables. Files that cannot be recognized will be ignored.
      * @return A list of Descriptors that were removed.
      */
-    static void scrubDataDirectories(String table, String columnFamily)
+    public static void scrubDataDirectories(String table, String columnFamily)
     {
         for (Map.Entry<Descriptor,Set<Component>> sstableFiles : files(table,
columnFamily, true).entrySet())
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=997490&r1=997489&r2=997490&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Wed Sep 15 20:38:53 2010
@@ -98,9 +98,6 @@ public class Table
                 tableInstance = instances.get(table);
                 if (tableInstance == null)
                 {
-                    // do some housekeeping on the column families.
-                    for (CFMetaData cfm : DatabaseDescriptor.getTableDefinition(table).cfMetaData().values())
-                        ColumnFamilyStore.scrubDataDirectories(table, cfm.cfName);
                     // open and store the table
                     tableInstance = new Table(table);
                     instances.put(table, tableInstance);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java?rev=997490&r1=997489&r2=997490&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java Wed
Sep 15 20:38:53 2010
@@ -27,6 +27,8 @@ import java.util.concurrent.SynchronousQ
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.db.ColumnFamilyStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -111,6 +113,14 @@ public abstract class AbstractCassandraD
             logger.error("Fatal exception during initialization", e);
             System.exit(100);
         }
+        
+        for (String table : DatabaseDescriptor.getTables()) 
+        {
+            for (CFMetaData cfm : DatabaseDescriptor.getTableMetaData(table).values())
+            {
+                ColumnFamilyStore.scrubDataDirectories(table, cfm.cfName);
+            }
+        }
 
         // initialize keyspaces
         for (String table : DatabaseDescriptor.getTables())



Mime
View raw message