cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r774025 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/db: ColumnFamilyStore.java Table.java
Date Tue, 12 May 2009 19:11:32 GMT
Author: jbellis
Date: Tue May 12 19:11:31 2009
New Revision: 774025

URL: http://svn.apache.org/viewvc?rev=774025&view=rev
Log:
cleanup ssTable filename tracking.  patch by jbellis

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

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=774025&r1=774024&r2=774025&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Tue
May 12 19:11:31 2009
@@ -83,7 +83,7 @@
     private AtomicReference<BinaryMemtable> binaryMemtable_;
 
     /* SSTables on disk for this column family */
-    private Set<String> ssTables_ = new TreeSet<String>(new FileNameComparator(FileNameComparator.Descending));
+    private SortedSet<String> ssTables_ = new TreeSet<String>(new FileNameComparator(FileNameComparator.Descending));
 
     /* Modification lock used for protecting reads from compactions. */
     private ReentrantReadWriteLock lock_ = new ReentrantReadWriteLock(true);
@@ -205,11 +205,6 @@
         }
     }
 
-    List<String> getAllSSTablesOnDisk()
-    {
-        return new ArrayList<String>(ssTables_);
-    }
-
     /*
      * This method is called to obtain statistics about
      * the Column Family represented by this Column Family
@@ -1527,9 +1522,9 @@
     }
 
     /** not threadsafe.  caller must have lock_ acquired. */
-    public Set<String> getSSTableFilenames()
+    public SortedSet<String> getSSTableFilenames()
     {
-        return Collections.unmodifiableSet(ssTables_);
+        return Collections.unmodifiableSortedSet(ssTables_);
     }
 
     public ReentrantReadWriteLock.ReadLock getReadLock()

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=774025&r1=774024&r2=774025&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Tue May 12 19:11:31
2009
@@ -572,7 +572,7 @@
     }
 
     /*
-     * Get the list of all SSTables on disk. 
+     * Get the list of all SSTables on disk.  Not safe unless you aquire the CFS readlocks!
     */
     public List<String> getAllSSTablesOnDisk()
     {
@@ -582,7 +582,7 @@
         {
             ColumnFamilyStore cfStore = columnFamilyStores_.get( columnFamily );
             if ( cfStore != null )
-                list.addAll( cfStore.getAllSSTablesOnDisk() );
+                list.addAll(cfStore.getSSTableFilenames());
         }
         return list;
     }



Mime
View raw message