src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
/**
     * Recycle processes an unneeded segment file for reuse.
     *
     * @return a new CommitLogSegment representing the newly reusable segment.
     */
Recycle processes an unneeded segment file for reuse.
@return a new CommitLogSegment representing the newly reusable segment.
Recycle processes an unneeded segment file for reuse . @return a new CommitLogSegment representing the newly reusable segment .
public CommitLogSegment recycle()
    {
        buffer.position(0);
        buffer.putInt(CommitLog.END_OF_SEGMENT_MARKER);
        buffer.position(0);
        try
        {
            sync();
        }
        catch (IOException e)
        {
            logger.warn("I/O error flushing " + this + " " + e);
        }
        close();
        return new CommitLogSegment(getPath());
    }
public CommitLogSegment recycle ( ) { buffer . position ( 0 ) ; buffer . putInt ( CommitLog . END_OF_SEGMENT_MARKER ) ; buffer . position ( 0 ) ; try { sync ( ) ; } catch ( IOException e ) { logger . warn ( "I/O error flushing " + this + " " + e ) ; } close ( ) ; return new CommitLogSegment ( getPath ( ) ) ; }
Recycle processes an unneeded segment file for reuse.
Recycle processes an unneeded segment file for reuse .
// writes an end-of-segment marker at the very beginning of the file and closes it // This is a best effort thing anyway