cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r957293 - /cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Date Wed, 23 Jun 2010 18:31:19 GMT
Author: gdusbabek
Date: Wed Jun 23 18:31:18 2010
New Revision: 957293

URL: http://svn.apache.org/viewvc?rev=957293&view=rev
Log:
CFS should ignore non-db files

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.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=957293&r1=957292&r2=957293&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Jun 23 18:31:18
2010
@@ -19,6 +19,7 @@
 package org.apache.cassandra.db;
 
 import java.io.File;
+import java.io.FilenameFilter;
 import java.io.IOError;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
@@ -92,6 +93,14 @@ public class ColumnFamilyStore implement
                                                new LinkedBlockingQueue<Runnable>(DatabaseDescriptor.getFlushWriters()),
                                                new NamedThreadFactory("FLUSH-WRITER-POOL"));
     private static ExecutorService commitLogUpdater_ = new JMXEnabledThreadPoolExecutor("MEMTABLE-POST-FLUSHER");
+    
+    private static final FilenameFilter DB_NAME_FILTER = new FilenameFilter()
+    {
+        public boolean accept(File dir, String name)
+        {
+            return name.matches("[^\\.][\\S]+?[\\.db]");
+        }
+    };
 
     private Set<Memtable> memtablesPendingFlush = new ConcurrentSkipListSet<Memtable>();
 
@@ -242,7 +251,7 @@ public class ColumnFamilyStore implement
         for (String directory : dataFileDirectories)
         {
             File fileDir = new File(directory);
-            File[] files = fileDir.listFiles();
+            File[] files = fileDir.listFiles(DB_NAME_FILTER);
             
             for (File file : files)
             {
@@ -283,7 +292,7 @@ public class ColumnFamilyStore implement
         Set<File> fileSet = new HashSet<File>();
         for (String directory : DatabaseDescriptor.getAllDataFileLocationsForTable(table_))
         {
-            File[] files = new File(directory).listFiles();
+            File[] files = new File(directory).listFiles(DB_NAME_FILTER);
             for (File file : files)
             {
                 if (file.isDirectory())



Mime
View raw message