def update_compaction(model):
logger.debug("<STR_LIT>", model)<EOL>table = get_table_settings(model)<EOL>existing_options = table.options.copy()<EOL>existing_compaction_strategy = existing_options['<STR_LIT>']<EOL>existing_options = json.loads(existing_options['<STR_LIT>'])<EOL>desired_options = get_compaction_options(model)<EOL>desired_compact_strategy = desired_options.get('<STR_LIT:class>', SizeTieredCompactionStrategy)<EOL>desired_options.pop('<STR_LIT:class>', None)<EOL>do_update = False<EOL>if desired_compact_strategy not in existing_compaction_strategy:<EOL><INDENT>do_update = True<EOL><DEDENT>for k, v in desired_options.items():<EOL><INDENT>val = existing_options.pop(k, None)<EOL>if val != v:<EOL><INDENT>do_update = True<EOL><DEDENT><DEDENT>if do_update:<EOL><INDENT>options = get_compaction_options(model)<EOL>options = json.dumps(options).replace('<STR_LIT:">', "<STR_LIT:'>")<EOL>cf_name = model.column_family_name()<EOL>query = "<STR_LIT>".format(cf_name, options)<EOL>logger.debug(query)<EOL>execute(query)<EOL>return True<EOL><DEDENT>return False<EOL>
Updates the compaction options for the given model if necessary.

    :param model: The model to update.

    :return: `True`, if the compaction options were modified in Cassandra,
        `False` otherwise.
    :rtype: bool