src/java/org/apache/cassandra/db/migration/Migration.java
/**
     * Definitions are serialized as a row with a UUID key, with a magical column named DEFINITION_SCHEMA_COLUMN_NAME
     * (containing the Avro Schema) and a column per keyspace. Each keyspace column contains a avro.KsDef object
     * encoded with the Avro schema.
     */
Definitions are serialized as a row with a UUID key, with a magical column named DEFINITION_SCHEMA_COLUMN_NAME
(containing the Avro Schema) and a column per keyspace. Each keyspace column contains a avro.KsDef object
encoded with the Avro schema.
Definitions are serialized as a row with a UUID key with a magical column named DEFINITION_SCHEMA_COLUMN_NAME ( containing the Avro Schema ) and a column per keyspace . Each keyspace column contains a avro . KsDef object encoded with the Avro schema .
final RowMutation makeDefinitionMutation(KSMetaData add, KSMetaData remove, UUID versionId) throws IOException
    {
        List<KSMetaData> ksms = new ArrayList<KSMetaData>();
        for (String tableName : schema.getNonSystemTables())
        {
            if (remove != null && remove.name.equals(tableName) || add != null && add.name.equals(tableName))
                continue;
            ksms.add(schema.getTableDefinition(tableName));
        }
        if (add != null)
            ksms.add(add);
        RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, toUTF8Bytes(versionId));
        long now = LamportClock.getVersion();
        for (KSMetaData ksm : ksms)
            rm.add(new QueryPath(SCHEMA_CF, null, ByteBufferUtil.bytes(ksm.name)), SerDeUtils.serialize(ksm.toAvro()), now);
        rm.add(new QueryPath(SCHEMA_CF,
                             null,
                             DefsTable.DEFINITION_SCHEMA_COLUMN_NAME),
                             ByteBufferUtil.bytes(org.apache.cassandra.db.migration.avro.KsDef.SCHEMA$.toString()),
                             now);
        return rm;
    }
final RowMutation makeDefinitionMutation ( KSMetaData add , KSMetaData remove , UUID versionId ) throws IOException { List < KSMetaData > ksms = new ArrayList < KSMetaData > ( ) ; for ( String tableName : schema . getNonSystemTables ( ) ) { if ( remove != null && remove . name . equals ( tableName ) || add != null && add . name . equals ( tableName ) ) continue ; ksms . add ( schema . getTableDefinition ( tableName ) ) ; } if ( add != null ) ksms . add ( add ) ; RowMutation rm = new RowMutation ( Table . SYSTEM_TABLE , toUTF8Bytes ( versionId ) ) ; long now = LamportClock . getVersion ( ) ; for ( KSMetaData ksm : ksms ) rm . add ( new QueryPath ( SCHEMA_CF , null , ByteBufferUtil . bytes ( ksm . name ) ) , SerDeUtils . serialize ( ksm . toAvro ( ) ) , now ) ; rm . add ( new QueryPath ( SCHEMA_CF , null , DefsTable . DEFINITION_SCHEMA_COLUMN_NAME ) , ByteBufferUtil . bytes ( org . apache . cassandra . db . migration . avro . KsDef . SCHEMA$ . toString ( ) ) , now ) ; return rm ; }
Definitions are serialized as a row with a UUID key, with a magical column named DEFINITION_SCHEMA_COLUMN_NAME
 (containing the Avro Schema) and a column per keyspace.
Definitions are serialized as a row with a UUID key with a magical column named DEFINITION_SCHEMA_COLUMN_NAME ( containing the Avro Schema ) and a column per keyspace .
// collect all keyspaces, while removing 'remove' and adding 'add' // wrap in mutation // add a column for each keyspace // add the schema