src/java/org/apache/cassandra/db/compaction/CompactionManager.java
/**
     * Call this whenever a compaction might be needed on the given columnfamily.
     * It's okay to over-call (within reason) since the compactions are single-threaded,
     * and if a call is unnecessary, it will just be no-oped in the bucketing phase.
     */
Call this whenever a compaction might be needed on the given columnfamily.
It's okay to over-call (within reason) since the compactions are single-threaded,
and if a call is unnecessary, it will just be no-oped in the bucketing phase.
Call this whenever a compaction might be needed on the given columnfamily . It ' s okay to over - call ( within reason ) since the compactions are single - threaded and if a call is unnecessary it will just be no - oped in the bucketing phase .
public Future<?> submitBackground(final ColumnFamilyStore cfs)
    {
        Runnable runnable = new WrappedRunnable()
        {
            protected void runMayThrow() throws IOException
            {
                compactionLock.readLock().lock();
                try
                {
                    AbstractCompactionStrategy strategy = cfs.getCompactionStrategy();
                    AbstractCompactionTask task = strategy.getNextBackgroundTask(getDefaultGcBefore(cfs));
                    if (task == null || !task.markSSTablesForCompaction())
                        return;
                    try
                    {
                        task.execute(executor);
                    }
                    finally
                    {
                        task.unmarkSSTables();
                    }
                    submitBackground(cfs);
                }
                finally 
                {
                    compactionLock.readLock().unlock();
                }
            }
        };
        return executor.submit(runnable);
    }
public Future < ? > submitBackground ( final ColumnFamilyStore cfs ) { Runnable runnable = new WrappedRunnable ( ) { protected void runMayThrow ( ) throws IOException { compactionLock . readLock ( ) . lock ( ) ; try { AbstractCompactionStrategy strategy = cfs . getCompactionStrategy ( ) ; AbstractCompactionTask task = strategy . getNextBackgroundTask ( getDefaultGcBefore ( cfs ) ) ; if ( task == null || ! task . markSSTablesForCompaction ( ) ) return ; try { task . execute ( executor ) ; } finally { task . unmarkSSTables ( ) ; } submitBackground ( cfs ) ; } finally { compactionLock . readLock ( ) . unlock ( ) ; } } } ; return executor . submit ( runnable ) ; }
Call this whenever a compaction might be needed on the given columnfamily.
Call this whenever a compaction might be needed on the given columnfamily .