src/java/org/apache/cassandra/db/ColumnFamilyStore.java
// must be called after all sstables are loaded since row cache merges all row versions
must be called after all sstables are loaded since row cache merges all row versions
must be called after all sstables are loaded since row cache merges all row versions
public void initRowCache()
    {
        long start = System.currentTimeMillis();
        AutoSavingCache<RowCacheKey, ColumnFamily> rowCache = CacheService.instance.rowCache;
        int cachedRowsRead = 0;
        for (DecoratedKey key : rowCache.readSaved(table.name, columnFamily))
        {
            cacheRow(metadata.cfId, key);
        }
        if (cachedRowsRead > 0)
            logger.info(String.format("completed loading (%d ms; %d keys) row cache for %s.%s",
                        System.currentTimeMillis() - start,
                        cachedRowsRead,
                        table.name,
                        columnFamily));
    }
public void initRowCache ( ) { long start = System . currentTimeMillis ( ) ; AutoSavingCache < RowCacheKey , ColumnFamily > rowCache = CacheService . instance . rowCache ; int cachedRowsRead = 0 ; for ( DecoratedKey key : rowCache . readSaved ( table . name , columnFamily ) ) { cacheRow ( metadata . cfId , key ) ; } if ( cachedRowsRead > 0 ) logger . info ( String . format ( "completed loading (%d ms; %d keys) row cache for %s.%s" , System . currentTimeMillis ( ) - start , cachedRowsRead , table . name , columnFamily ) ) ; }
must be called after all sstables are loaded since row cache merges all row versions
must be called after all sstables are loaded since row cache merges all row versions
// results are sorted on read (via treeset) because there are few reads and many writes and reads only happen at startup