src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
/**
     * Appends a row mutation onto the commit log.  Requres that hasCapacityFor has already been checked.
     *
     * @param   rowMutation   the mutation to append to the commit log.
     * @return  the position of the appended mutation
     */
Appends a row mutation onto the commit log.  Requres that hasCapacityFor has already been checked.
@param   rowMutation   the mutation to append to the commit log.
@return  the position of the appended mutation
Appends a row mutation onto the commit log . Requres that hasCapacityFor has already been checked . @param rowMutation the mutation to append to the commit log . @return the position of the appended mutation
public ReplayPosition write(RowMutation rowMutation) throws IOException
    {
        assert !closed;
        ReplayPosition repPos = getContext();
        markDirty(rowMutation, repPos);
        CRC32 checksum = new CRC32();
        byte[] serializedRow = rowMutation.getSerializedBuffer(MessagingService.version_);
        checksum.update(serializedRow.length);
        buffer.putInt(serializedRow.length);
        buffer.putLong(checksum.getValue());
        buffer.put(serializedRow);
        checksum.update(serializedRow);
        buffer.putLong(checksum.getValue());
        if (buffer.remaining() >= 4)
        {
            buffer.putInt(CommitLog.END_OF_SEGMENT_MARKER);
            buffer.position(buffer.position() - CommitLog.END_OF_SEGMENT_MARKER_SIZE);
        }
        needsSync = true;
        return repPos;
    }
public ReplayPosition write ( RowMutation rowMutation ) throws IOException { assert ! closed ; ReplayPosition repPos = getContext ( ) ; markDirty ( rowMutation , repPos ) ; CRC32 checksum = new CRC32 ( ) ; byte [ ] serializedRow = rowMutation . getSerializedBuffer ( MessagingService . version_ ) ; checksum . update ( serializedRow . length ) ; buffer . putInt ( serializedRow . length ) ; buffer . putLong ( checksum . getValue ( ) ) ; buffer . put ( serializedRow ) ; checksum . update ( serializedRow ) ; buffer . putLong ( checksum . getValue ( ) ) ; if ( buffer . remaining ( ) >= 4 ) { buffer . putInt ( CommitLog . END_OF_SEGMENT_MARKER ) ; buffer . position ( buffer . position ( ) - CommitLog . END_OF_SEGMENT_MARKER_SIZE ) ; } needsSync = true ; return repPos ; }
Appends a row mutation onto the commit log.
Appends a row mutation onto the commit log .
// writes end of segment marker and rewinds back to position where it starts