cleanup ssTable filename tracking. patch by jbellis

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@774025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-05-12 19:11:31 +00:00
parent b460bd71c5
commit da441aed29
2 changed files with 5 additions and 10 deletions

View File

@ -83,7 +83,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
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 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
}
}
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 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
}
/** 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()

View File

@ -572,7 +572,7 @@ public class Table
}
/*
* 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 @@ public class Table
{
ColumnFamilyStore cfStore = columnFamilyStores_.get( columnFamily );
if ( cfStore != null )
list.addAll( cfStore.getAllSSTablesOnDisk() );
list.addAll(cfStore.getSSTableFilenames());
}
return list;
}