src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
/**
     * Force a flush on all dirty CFs represented in the oldest commitlog segment
     */
Force a flush on all dirty CFs represented in the oldest commitlog segment
Force a flush on all dirty CFs represented in the oldest commitlog segment
private void flushOldestTables()
    {
        CommitLogSegment oldestSegment = activeSegments.peek();
        if (oldestSegment != null)
        {
            for (Integer dirtyCFId : oldestSegment.getDirtyCFIDs())
            {
                String keypace = Schema.instance.getCF(dirtyCFId).left;
                final ColumnFamilyStore cfs = Table.open(keypace).getColumnFamilyStore(dirtyCFId);
                Runnable runnable = new Runnable()
                {
                    public void run()
                    {
                        cfs.forceFlush();
                    }
                };
                StorageService.optionalTasks.execute(runnable);
            }
        }
    }
private void flushOldestTables ( ) { CommitLogSegment oldestSegment = activeSegments . peek ( ) ; if ( oldestSegment != null ) { for ( Integer dirtyCFId : oldestSegment . getDirtyCFIDs ( ) ) { String keypace = Schema . instance . getCF ( dirtyCFId ) . left ; final ColumnFamilyStore cfs = Table . open ( keypace ) . getColumnFamilyStore ( dirtyCFId ) ; Runnable runnable = new Runnable ( ) { public void run ( ) { cfs . forceFlush ( ) ; } } ; StorageService . optionalTasks . execute ( runnable ) ; } } }
Force a flush on all dirty CFs represented in the oldest commitlog segment
Force a flush on all dirty CFs represented in the oldest commitlog segment
// flush shouldn't run on the commitlog executor, since it acquires Table.switchLock, // which may already be held by a thread waiting for the CL executor (via getContext), // causing deadlock