You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/08/26 19:39:26 UTC

svn commit: r989837 - /cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java

Author: jbellis
Date: Thu Aug 26 17:39:25 2010
New Revision: 989837

URL: http://svn.apache.org/viewvc?rev=989837&view=rev
Log:
make it clear that no duplicates are present by returning a Set.  patch by jbellis

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java?rev=989837&r1=989836&r2=989837&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/DefsTable.java Thu Aug 26 17:39:25 2010
@@ -40,11 +40,7 @@ import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 import static com.google.common.base.Charsets.UTF_8;
 
@@ -113,16 +109,16 @@ public class DefsTable
     }
     
     /** gets all the files that belong to a given column family. */
-    public static Collection<File> getFiles(String table, final String cf)
+    public static Set<File> getFiles(String table, final String cf)
     {
-        List<File> found = new ArrayList<File>();
+        Set<File> found = new HashSet<File>();
         for (String path : DatabaseDescriptor.getAllDataFileLocationsForTable(table))
         {
             File[] dbFiles = new File(path).listFiles(new FileFilter()
             {
                 public boolean accept(File pathname)
                 {
-                    return pathname.getName().startsWith(cf + "-") && pathname.getName().endsWith(".db") && pathname.exists();        
+                    return pathname.getName().startsWith(cf + "-") && pathname.getName().endsWith(".db") && pathname.exists();
                 }
             });
             found.addAll(Arrays.asList(dbFiles));