src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
/**
     * Differs from the above because it can work on any file instead of just existing
     * commit log segments managed by this allocator.
     *
     * @param file segment file that is no longer in use.
     */
Differs from the above because it can work on any file instead of just existing
commit log segments managed by this allocator.

@param file segment file that is no longer in use.
Differs from the above because it can work on any file instead of just existing commit log segments managed by this allocator . @param file segment file that is no longer in use .
public void recycleSegment(final File file)
    {
        if (isCapExceeded() || file.length() != CommitLog.SEGMENT_SIZE)
        {
            try
            {
                FileUtils.deleteWithConfirm(file);
            }
            catch (IOException e)
            {
                throw new IOError(e);
            }
            return;
        }
        queue.add(new Runnable()
        {
            public void run()
            {
                CommitLogSegment segment = new CommitLogSegment(file.getPath());
                internalAddReadySegment(segment);
            }
        });
    }
public void recycleSegment ( final File file ) { if ( isCapExceeded ( ) || file . length ( ) != CommitLog . SEGMENT_SIZE ) { try { FileUtils . deleteWithConfirm ( file ) ; } catch ( IOException e ) { throw new IOError ( e ) ; } return ; } queue . add ( new Runnable ( ) { public void run ( ) { CommitLogSegment segment = new CommitLogSegment ( file . getPath ( ) ) ; internalAddReadySegment ( segment ) ; } } ) ; }
Differs from the above because it can work on any file instead of just existing
 commit log segments managed by this allocator.
Differs from the above because it can work on any file instead of just existing commit log segments managed by this allocator .
// check against SEGMENT_SIZE avoids recycling odd-sized or empty segments from old C* versions and unit tests