src/java/org/apache/cassandra/db/CollationController.java
/**
     * Collects data the brute-force way: gets an iterator for the filter in question
     * from every memtable and sstable, then merges them together.
     */
Collects data the brute-force way: gets an iterator for the filter in question
from every memtable and sstable, then merges them together.
Collects data the brute - force way : gets an iterator for the filter in question from every memtable and sstable then merges them together .
private ColumnFamily collectAllData()
    {
        logger.debug("collectAllData");
        ISortedColumns.Factory factory = mutableColumns
                                       ? AtomicSortedColumns.factory()
                                       : ArrayBackedSortedColumns.factory();
        List<IColumnIterator> iterators = new ArrayList<IColumnIterator>();
        ColumnFamily returnCF = ColumnFamily.create(cfs.metadata, factory, filter.filter.isReversed());
        ColumnFamilyStore.ViewFragment view = cfs.markReferenced(filter.key);
        try
        {
            for (Memtable memtable : view.memtables)
            {
                IColumnIterator iter = filter.getMemtableColumnIterator(memtable);
                if (iter != null)
                {
                    returnCF.delete(iter.getColumnFamily());
                    iterators.add(iter);
                }
            }
            for (SSTableReader sstable : view.sstables)
            {
                IColumnIterator iter = filter.getSSTableColumnIterator(sstable);
                iterators.add(iter);
                if (iter.getColumnFamily() != null)
                {
                    returnCF.delete(iter.getColumnFamily());
                    sstablesIterated++;
                }
            }
            if (iterators.isEmpty())
                return null;
            filter.collateColumns(returnCF, iterators, gcBefore);
            return returnCF;
        }
        finally
        {
            for (IColumnIterator iter : iterators)
                FileUtils.closeQuietly(iter);
            SSTableReader.releaseReferences(view.sstables);
        }
    }
private ColumnFamily collectAllData ( ) { logger . debug ( "collectAllData" ) ; ISortedColumns . Factory factory = mutableColumns ? AtomicSortedColumns . factory ( ) : ArrayBackedSortedColumns . factory ( ) ; List < IColumnIterator > iterators = new ArrayList < IColumnIterator > ( ) ; ColumnFamily returnCF = ColumnFamily . create ( cfs . metadata , factory , filter . filter . isReversed ( ) ) ; ColumnFamilyStore . ViewFragment view = cfs . markReferenced ( filter . key ) ; try { for ( Memtable memtable : view . memtables ) { IColumnIterator iter = filter . getMemtableColumnIterator ( memtable ) ; if ( iter != null ) { returnCF . delete ( iter . getColumnFamily ( ) ) ; iterators . add ( iter ) ; } } for ( SSTableReader sstable : view . sstables ) { IColumnIterator iter = filter . getSSTableColumnIterator ( sstable ) ; iterators . add ( iter ) ; if ( iter . getColumnFamily ( ) != null ) { returnCF . delete ( iter . getColumnFamily ( ) ) ; sstablesIterated ++ ; } } if ( iterators . isEmpty ( ) ) return null ; filter . collateColumns ( returnCF , iterators , gcBefore ) ; return returnCF ; } finally { for ( IColumnIterator iter : iterators ) FileUtils . closeQuietly ( iter ) ; SSTableReader . releaseReferences ( view . sstables ) ; } }
Collects data the brute-force way: gets an iterator for the filter in question
 from every memtable and sstable, then merges them together.
Collects data the brute - force way : gets an iterator for the filter in question from every memtable and sstable then merges them together .
// we need to distinguish between "there is no data at all for this row" (BF will let us rebuild that efficiently) // and "there used to be data, but it's gone now" (we should cache the empty CF so we don't need to rebuild that slower) // Caller is responsible for final removeDeletedCF.  This is important for cacheRow to work correctly: